mirror of https://github.com/rancher/ui.git
Single button on apikey create overlay (rancher/rancher#1490)
This commit is contained in:
parent
d93dcb0c45
commit
33704dca99
|
|
@ -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');
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue