Fixed: Issue with custom formats when profile was saved with non existing formats. Also you now don't have to refresh your browser for them to appear / disappear.
parent
bf7689688d
commit
354105cf08
@ -1,8 +1,28 @@
|
|||||||
var Backbone = require('backbone');
|
var Backbone = require('backbone');
|
||||||
var IndexerModel = require('./CustomFormatModel');
|
var IndexerModel = require('./CustomFormatModel');
|
||||||
|
|
||||||
|
var vent = require('vent');
|
||||||
|
|
||||||
module.exports = Backbone.Collection.extend({
|
module.exports = Backbone.Collection.extend({
|
||||||
model : IndexerModel,
|
model : IndexerModel,
|
||||||
url : window.NzbDrone.ApiRoot + '/customformat'
|
url : window.NzbDrone.ApiRoot + '/customformat',
|
||||||
|
|
||||||
|
sync : function(method, model, options) {
|
||||||
|
vent.trigger(vent.Events.CustomFormatsChanged, {method : method});
|
||||||
|
|
||||||
|
Backbone.Collection.prototype.sync.apply(this, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
|
add : function(model, options) {
|
||||||
|
vent.trigger(vent.Events.CustomFormatsChanged, {options : options});
|
||||||
|
|
||||||
|
Backbone.Collection.prototype.add.apply(this, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
|
remove : function(model, options) {
|
||||||
|
vent.trigger(vent.Events.CustomFormatsChanged, {options : options});
|
||||||
|
|
||||||
|
Backbone.Collection.prototype.remove.apply(this, arguments);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in new issue