Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Ember from 'ember';
- export default Ember.Component.extend({
- tagName: 'button',
- classNameBindings: ['isActive:is-active'],
- isActive: Ember.computed('activeTool', function(){
- return this.get('activeTool') === this.get('tool');
- }),
- click(){
- const activeTool = this.get('activeTool');
- if (activeTool === this.get('tool')){
- this.sendAction('activate', null);
- } else {
- this.sendAction('activate', this.get('tool'));
- }
- },
- activeTool: Ember.computed({
- get(){
- return;
- },
- set(k, v){
- console.log('tool activeTool.set', this.get('tool.description'));
- return v;
- }
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement