From 5b1f9c1aeb3a3f880a8b8cbe3f09e73127ff2bf4 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Tue, 10 Jun 2014 22:40:27 -0400 Subject: [PATCH] removed extraneous references to app-connect Views (removed in f33726a) --- .../src/main/webapp/resources/js/dynreg.js | 1 - .../src/main/webapp/resources/js/grant.js | 2 +- .../src/main/webapp/resources/js/rsreg.js | 1 - .../src/main/webapp/resources/js/scope.js | 14 +++++++++----- .../src/main/webapp/resources/js/token.js | 2 +- .../src/main/webapp/resources/js/whitelist.js | 14 +++++++++----- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js b/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js index 66d57793b..59c7e0647 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js @@ -225,7 +225,6 @@ var DynRegEditView = Backbone.View.extend({ } }); - app.clientListView.delegateEvents(); } return false; diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js b/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js index 09e226c73..64e7250fe 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js @@ -278,7 +278,7 @@ var ApprovedSiteView = Backbone.View.extend({ }); - app.approvedSiteListView.delegateEvents(); + this.parentView.delegateEvents(); } return false; diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js b/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js index 9c327a42f..b4a639c08 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js @@ -225,7 +225,6 @@ var ResRegEditView = Backbone.View.extend({ } }); - app.clientListView.delegateEvents(); } return false; diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js b/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js index 4bb942dd7..760ec80a4 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js @@ -107,15 +107,15 @@ var SystemScopeView = Backbone.View.extend({ e.preventDefault(); if (confirm("Are you sure sure you would like to delete this scope? Clients that have this scope will still be able to ask for it.")) { - var self = this; + var _self = this; this.model.destroy({ success:function () { - self.$el.fadeTo("fast", 0.00, function () { //fade + _self.$el.fadeTo("fast", 0.00, function () { //fade $(this).slideUp("fast", function () { //slide up $(this).remove(); //then remove from the DOM - app.systemScopeListView.togglePlaceholder(); + _self.parentView.togglePlaceholder(); }); }); }, @@ -136,7 +136,7 @@ var SystemScopeView = Backbone.View.extend({ } }); - app.systemScopeListView.delegateEvents(); + _self.parentView.delegateEvents(); } return false; @@ -204,8 +204,12 @@ var SystemScopeListView = Backbone.View.extend({ // append and render the table structure $(this.el).html($('#tmpl-system-scope-table').html()); + var _self = this; + _.each(this.model.models, function (scope) { - $("#scope-table", this.el).append(new SystemScopeView({model: scope}).render().el); + var view = new SystemScopeView({model: scope}); + view.parentView = _self; + $("#scope-table", _self.el).append(view.render().el); }, this); this.togglePlaceholder(); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/token.js b/openid-connect-server-webapp/src/main/webapp/resources/js/token.js index 4d4972c49..78f68cb17 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/token.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/token.js @@ -280,7 +280,7 @@ var RefreshTokenView = Backbone.View.extend({ } }); - app.tokensListView.delegateEvents(); + _self.parentView.delegateEvents(); } return false; diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js index a7da26a5c..833b42da5 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js @@ -80,6 +80,8 @@ var WhiteListListView = Backbone.View.extend({ render:function (eventName) { $(this.el).html($('#tmpl-whitelist-table').html()); + var _self = this; + _.each(this.model.models, function (whiteList) { // look up client @@ -87,7 +89,9 @@ var WhiteListListView = Backbone.View.extend({ // if there's no client ID, this is an error! if (client != null) { - $('#whitelist-table', this.el).append(new WhiteListView({model: whiteList, client: client, systemScopeList: this.options.systemScopeList}).render().el); + var view = new WhiteListView({model: whiteList, client: client, systemScopeList: this.options.systemScopeList}); + view.parentView = _self; + $('#whitelist-table', this.el).append(view.render().el); } }, this); @@ -175,15 +179,15 @@ var WhiteListView = Backbone.View.extend({ e.preventDefault(); if (confirm("Are you sure you want to delete this whitelist entry?")) { - var self = this; + var _self = this; this.model.destroy({ success:function () { - self.$el.fadeTo("fast", 0.00, function () { //fade + _self.$el.fadeTo("fast", 0.00, function () { //fade $(this).slideUp("fast", function () { //slide up $(this).remove(); //then remove from the DOM // check the placeholder in case it's empty now - app.whiteListListView.togglePlaceholder(); + _self.parentView.togglePlaceholder(); }); }); }, @@ -205,7 +209,7 @@ var WhiteListView = Backbone.View.extend({ } }); - app.whiteListListView.delegateEvents(); + _self.parentView.delegateEvents(); } return false;