FIX: enable button is broken when color scheme is not saved yet
This commit is contained in:
parent
15b0cd5185
commit
57c970b692
|
@ -43,6 +43,10 @@ Discourse.ColorScheme = Discourse.Model.extend(Ember.Copyable, {
|
||||||
return !this.get('changed') || this.get('saving') || _.any(this.get('colors'), function(c) { return !c.get('valid'); });
|
return !this.get('changed') || this.get('saving') || _.any(this.get('colors'), function(c) { return !c.get('valid'); });
|
||||||
}.property('changed'),
|
}.property('changed'),
|
||||||
|
|
||||||
|
disableEnable: function() {
|
||||||
|
return !this.get('id') || this.get('saving');
|
||||||
|
}.property('id', 'saving'),
|
||||||
|
|
||||||
newRecord: function() {
|
newRecord: function() {
|
||||||
return (!this.get('id'));
|
return (!this.get('id'));
|
||||||
}.property('id'),
|
}.property('id'),
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<button {{action save}} {{bind-attr disabled="disableSave"}} class='btn'>{{i18n admin.customize.save}}</button>
|
<button {{action save}} {{bind-attr disabled="disableSave"}} class='btn'>{{i18n admin.customize.save}}</button>
|
||||||
<button {{action toggleEnabled}} class="btn">
|
<button {{action toggleEnabled}} {{bind-attr disabled="disableEnable"}} class="btn">
|
||||||
{{#if enabled}}
|
{{#if enabled}}
|
||||||
{{i18n disable}}
|
{{i18n disable}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
Loading…
Reference in New Issue