mirror of https://github.com/lidarr/Lidarr
Cancelling quality profile editing will refetch it from the server
This commit is contained in:
parent
191db1c541
commit
c4fc3e77b3
|
@ -20,7 +20,8 @@ define(
|
||||||
},
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click .x-save': '_saveQualityProfile'
|
'click .x-save' : '_saveQualityProfile',
|
||||||
|
'click .x-cancel': '_cancelQualityProfile'
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function (options) {
|
initialize: function (options) {
|
||||||
|
@ -85,6 +86,21 @@ define(
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_cancelQualityProfile: function () {
|
||||||
|
if (!this.model.has('id')) {
|
||||||
|
vent.trigger(vent.Commands.CloseModalCommand);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var promise = this.model.fetch();
|
||||||
|
|
||||||
|
if (promise) {
|
||||||
|
promise.done(function () {
|
||||||
|
vent.trigger(vent.Commands.CloseModalCommand);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_showFieldsView: function () {
|
_showFieldsView: function () {
|
||||||
this.fields.show(this.fieldsView);
|
this.fields.show(this.fieldsView);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close x-cancel" aria-hidden="true">×</button>
|
||||||
{{#if id}}
|
{{#if id}}
|
||||||
<h3>Edit</h3>
|
<h3>Edit</h3>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -24,6 +24,6 @@
|
||||||
{{#if id}}
|
{{#if id}}
|
||||||
<button class="btn btn-danger pull-left x-delete">delete</button>
|
<button class="btn btn-danger pull-left x-delete">delete</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<button class="btn" data-dismiss="modal">cancel</button>
|
<button class="btn x-cancel">cancel</button>
|
||||||
<button class="btn btn-primary x-save">save</button>
|
<button class="btn btn-primary x-save">save</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue