FIX: enable button is broken when color scheme is not saved yet

This commit is contained in:
Neil Lalonde 2014-05-15 14:55:10 -04:00
parent 15b0cd5185
commit 57c970b692
2 changed files with 5 additions and 1 deletions

View File

@ -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'); });
}.property('changed'),
disableEnable: function() {
return !this.get('id') || this.get('saving');
}.property('id', 'saving'),
newRecord: function() {
return (!this.get('id'));
}.property('id'),

View File

@ -18,7 +18,7 @@
<div class="controls">
<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}}
{{i18n disable}}
{{else}}