1
0
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:
Mark McDowall
2015-06-25 00:10:40 -07:00
parent 2fbf7a4114
commit b82e830e86
13 changed files with 429 additions and 342 deletions
@@ -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);