mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 09:33:52 -07:00
UI dependency graph cleanup
This commit is contained in:
parent
86ea33b638
commit
4948d0608b
87 changed files with 1119 additions and 735 deletions
|
@ -1,12 +1,16 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'vent',
|
||||
'Commands/CommandModel',
|
||||
'Commands/CommandCollection',
|
||||
'Commands/CommandMessengerCollectionView',
|
||||
'underscore',
|
||||
'jQuery/jquery.spin'
|
||||
], function (App, CommandModel, CommandCollection, _) {
|
||||
], function (vent, CommandModel, CommandCollection, CommandMessengerCollectionView, _) {
|
||||
|
||||
|
||||
CommandMessengerCollectionView.render();
|
||||
|
||||
var singleton = function () {
|
||||
|
||||
|
@ -33,11 +37,18 @@ define(
|
|||
this._bindToCommandModel.call(this, existingCommand, options);
|
||||
}
|
||||
|
||||
CommandCollection.bind('add sync', function (model) {
|
||||
CommandCollection.bind('add', function (model) {
|
||||
if (model.isSameCommand(options.command)) {
|
||||
self._bindToCommandModel.call(self, model, options);
|
||||
}
|
||||
});
|
||||
|
||||
CommandCollection.bind('add sync', function () {
|
||||
var command = CommandCollection.findCommand(options.command);
|
||||
if (command) {
|
||||
self._bindToCommandModel.call(self, command, options);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_bindToCommandModel: function bindToCommand(model, options) {
|
||||
|
@ -52,7 +63,7 @@ define(
|
|||
options.element.stopSpin();
|
||||
|
||||
if (model.isComplete()) {
|
||||
App.vent.trigger(App.Events.CommandComplete, { command: model, model: options.model });
|
||||
vent.trigger(vent.Events.CommandComplete, { command: model, model: options.model });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue