mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-21 22:05:43 -04:00
Cleanup and refactoring of Twitter notifications
Closes #301 New: Twitter Notifications
This commit is contained in:
@@ -16,12 +16,10 @@ var view = Marionette.ItemView.extend({
|
||||
onDownloadToggle : '.x-on-download',
|
||||
onUpgradeSection : '.x-on-upgrade',
|
||||
tags : '.x-tags',
|
||||
indicator : '.x-indicator',
|
||||
modalBody : '.x-modal-body',
|
||||
formTag : '.x-form-tag',
|
||||
path : '.x-path',
|
||||
authorizedNotificationButton : '.AuthorizeNotification'
|
||||
tags : '.x-tags',
|
||||
modalBody : '.modal-body',
|
||||
formTag : '.x-form-tag',
|
||||
path : '.x-path'
|
||||
},
|
||||
|
||||
events : {
|
||||
@@ -87,13 +85,16 @@ var view = Marionette.ItemView.extend({
|
||||
}
|
||||
},
|
||||
|
||||
_onAuthorizeNotification : function(e) {
|
||||
var self = this;
|
||||
self.ui.indicator.show();
|
||||
this.model.connectData(this.ui.authorizedNotificationButton.data('value')).always(function(newValues) {
|
||||
self.ui.indicator.hide();
|
||||
});
|
||||
}
|
||||
_onAuthorizeNotification : function() {
|
||||
var self = this;
|
||||
var callbackUrl = window.location.origin + '/oauth.html';
|
||||
this.ui.indicator.show();
|
||||
var promise = this.model.connectData(this.ui.authorizedNotificationButton.data('value') + '?callbackUrl=' + callbackUrl);
|
||||
|
||||
promise.always(function() {
|
||||
self.ui.indicator.hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
|
||||
Reference in New Issue
Block a user