Single button on apikey create overlay (rancher/rancher#1490)

This commit is contained in:
Vincent Fiduccia 2015-07-13 12:13:36 -07:00
parent d93dcb0c45
commit 33704dca99
2 changed files with 20 additions and 1 deletions

View File

@ -11,6 +11,11 @@ export default Ember.Component.extend(NewOrEdit,{
this.set('model', this.get('originalModel').clone());
},
canSave: function() {
return (this.get('originalModel.name')||'') !== (this.get('model.name')||'') ||
(this.get('originalModel.description')||'') !== (this.get('model.description')||'');
}.property('originalModel.{name,description}','model.{name,description}'),
doneSaving: function() {
this.sendAction('dismiss');
},

View File

@ -34,5 +34,19 @@
{{textarea value=primaryResource.description classNames="form-control no-resize" rows="5" placeholder="e.g. This key is used by the app servers to deploy containers"}}
</div>
{{partial "save-cancel"}}
{{#if justCreated}}
<div class="footer-actions">
{{#if saving}}
<button class="btn btn-primary btn-disabled"><i class="fa fa-spinner fa-spin"></i> Saving...</button>
{{else}}
{{#if canSave}}
<button {{action "save"}} class="btn btn-primary">Save</button>
{{else}}
<button {{action "cancel"}} class="btn btn-primary">Close</button>
{{/if}}
{{/if}}
</div>
{{else}}
{{partial "save-cancel"}}
{{/if}}
</section>