|
|
|
@ -138,16 +138,20 @@ module.exports = Backbone.View.extend({ |
|
|
|
}, |
|
|
|
|
|
|
|
toogleActive() { |
|
|
|
var active = this.model.get('active'); |
|
|
|
this.model.set('active', !active); |
|
|
|
const { model } = this; |
|
|
|
const { active, togglable } = model.attributes; |
|
|
|
|
|
|
|
if (active && !togglable) return; |
|
|
|
|
|
|
|
model.set('active', !active); |
|
|
|
|
|
|
|
// If the stop is requested
|
|
|
|
var command = this.em.get('Commands').get('select-comp'); |
|
|
|
|
|
|
|
if (active) { |
|
|
|
if (this.model.get('runDefaultCommand')) this.em.runDefault(); |
|
|
|
if (model.get('runDefaultCommand')) this.em.runDefault(); |
|
|
|
} else { |
|
|
|
if (this.model.get('stopDefaultCommand')) this.em.stopDefault(); |
|
|
|
if (model.get('stopDefaultCommand')) this.em.stopDefault(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|