Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import Ember from 'ember';
  2.  
  3. export default Ember.Component.extend({
  4. didInsertElement() {
  5. this._super(...arguments);
  6.  
  7. let canvas = this.$('.triangle')[0];
  8. if (canvas.getContext) {
  9. var ctx = canvas.getContext('2d');
  10.  
  11. ctx.beginPath();
  12. ctx.moveTo(0, 0);
  13. ctx.lineTo(100, 0);
  14. ctx.lineTo(100, 100);
  15. ctx.lineTo(0, 0);
  16. ctx.fillStyle = 'seagreen';
  17. ctx.fill();
  18. ctx.font = "20pt FontAwesome";
  19. ctx.fillStyle = 'white';
  20. ctx.fillText('\uf201', 55, 43);
  21. }
  22. },
  23.  
  24. actions: {
  25. handleTransition(project, event) {
  26. if (event.target.className === 'triangle') {
  27. return this.get('browseTransition')(project.id);
  28. }
  29.  
  30. return this.get('projectTransition')(project.id);
  31. }
  32. }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement