|
@@ -45,9 +45,8 @@ App.NumLlapNodesWidgetMixin = Em.Mixin.create({
|
|
var readOnly = this.get('readOnly');
|
|
var readOnly = this.get('readOnly');
|
|
this.set('disabled', readOnly);
|
|
this.set('disabled', readOnly);
|
|
this.set('supportSwitchToTextBox', !readOnly);
|
|
this.set('supportSwitchToTextBox', !readOnly);
|
|
- if (readOnly) {
|
|
|
|
- this.toggleSlider('disable');
|
|
|
|
- }
|
|
|
|
|
|
+ var action = readOnly ? 'disable' : 'enable';
|
|
|
|
+ this.toggleSlider(action);
|
|
}.observes('readOnly'),
|
|
}.observes('readOnly'),
|
|
|
|
|
|
toggleWidgetView: function() {
|
|
toggleWidgetView: function() {
|
|
@@ -63,7 +62,7 @@ App.NumLlapNodesWidgetMixin = Em.Mixin.create({
|
|
toggleSlider: function (action) {
|
|
toggleSlider: function (action) {
|
|
var self = this;
|
|
var self = this;
|
|
Em.run.next(function () {
|
|
Em.run.next(function () {
|
|
- self.get('slider')[action]();
|
|
|
|
|
|
+ Em.tryInvoke(self.get('slider'), action);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|