mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
Toolbar/Actioneer callback cleanup
This commit is contained in:
parent
1df9c49c46
commit
cdf34d5676
8 changed files with 22 additions and 23 deletions
|
@ -30,8 +30,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
|
|||
});
|
||||
}
|
||||
|
||||
if (options.successCallback) {
|
||||
options.successCallback.call(options.context);
|
||||
if (options.onSuccess) {
|
||||
options.onSuccess.call(options.context);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -47,8 +47,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
|
|||
});
|
||||
}
|
||||
|
||||
if (options.failCallback) {
|
||||
options.failCallback.call(options.context);
|
||||
if (options.onError) {
|
||||
options.onError.call(options.context);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -63,8 +63,8 @@ define(['Commands/CommandController', 'Shared/Messenger'],
|
|||
options.element.removeClass('icon-nd-spinner');
|
||||
}
|
||||
|
||||
if (options.alwaysCallback) {
|
||||
options.alwaysCallback.call(options.context);
|
||||
if (options.always) {
|
||||
options.always.call(options.context);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -62,12 +62,12 @@ define(
|
|||
});
|
||||
}
|
||||
|
||||
if (self.model.get('successCallback')) {
|
||||
if (self.model.get('onSuccess')) {
|
||||
if (!self.model.ownerContext) {
|
||||
throw 'ownerContext must be set.';
|
||||
}
|
||||
|
||||
self.model.get('successCallback').call(self.model.ownerContext);
|
||||
self.model.get('onSuccess').call(self.model.ownerContext);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -83,12 +83,12 @@ define(
|
|||
});
|
||||
}
|
||||
|
||||
if (self.model.get('failCallback')) {
|
||||
if (self.model.get('onError')) {
|
||||
if (!self.model.ownerContext) {
|
||||
throw 'ownerContext must be set.';
|
||||
}
|
||||
|
||||
self.model.get('failCallback').call(self.model.ownerContext);
|
||||
self.model.get('onError').call(self.model.ownerContext);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -100,12 +100,12 @@ define(
|
|||
}
|
||||
});
|
||||
|
||||
if (self.model.get('alwaysCallback')) {
|
||||
if (self.model.get('always')) {
|
||||
if (!self.model.ownerContext) {
|
||||
throw 'ownerContext must be set.';
|
||||
}
|
||||
|
||||
self.model.get('alwaysCallback').call(self.model.ownerContext);
|
||||
self.model.get('always').call(self.model.ownerContext);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue