Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import Ember from 'ember';
  2.  
  3. export default Ember.Component.extend({
  4. tagName: 'button',
  5. classNameBindings: ['isActive:is-active'],
  6.  
  7. isActive: Ember.computed('activeTool', function(){
  8. return this.get('activeTool') === this.get('tool');
  9. }),
  10.  
  11. click(){
  12. const activeTool = this.get('activeTool');
  13. if (activeTool === this.get('tool')){
  14. this.sendAction('activate', null);
  15. } else {
  16. this.sendAction('activate', this.get('tool'));
  17. }
  18. },
  19.  
  20. activeTool: Ember.computed({
  21. get(){
  22. return;
  23. },
  24. set(k, v){
  25. console.log('tool activeTool.set', this.get('tool.description'));
  26. return v;
  27. }
  28. })
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement