removed extraneous references to app-connect Views (removed in f33726a)

pull/618/head
Justin Richer 2014-06-10 22:40:27 -04:00
parent d922a98783
commit 5b1f9c1aeb
6 changed files with 20 additions and 14 deletions

View File

@ -225,7 +225,6 @@ var DynRegEditView = Backbone.View.extend({
} }
}); });
app.clientListView.delegateEvents();
} }
return false; return false;

View File

@ -278,7 +278,7 @@ var ApprovedSiteView = Backbone.View.extend({
}); });
app.approvedSiteListView.delegateEvents(); this.parentView.delegateEvents();
} }
return false; return false;

View File

@ -225,7 +225,6 @@ var ResRegEditView = Backbone.View.extend({
} }
}); });
app.clientListView.delegateEvents();
} }
return false; return false;

View File

@ -107,15 +107,15 @@ var SystemScopeView = Backbone.View.extend({
e.preventDefault(); 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.")) { 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({ this.model.destroy({
success:function () { 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).slideUp("fast", function () { //slide up
$(this).remove(); //then remove from the DOM $(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; return false;
@ -204,8 +204,12 @@ var SystemScopeListView = Backbone.View.extend({
// append and render the table structure // append and render the table structure
$(this.el).html($('#tmpl-system-scope-table').html()); $(this.el).html($('#tmpl-system-scope-table').html());
var _self = this;
_.each(this.model.models, function (scope) { _.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);
this.togglePlaceholder(); this.togglePlaceholder();

View File

@ -280,7 +280,7 @@ var RefreshTokenView = Backbone.View.extend({
} }
}); });
app.tokensListView.delegateEvents(); _self.parentView.delegateEvents();
} }
return false; return false;

View File

@ -80,6 +80,8 @@ var WhiteListListView = Backbone.View.extend({
render:function (eventName) { render:function (eventName) {
$(this.el).html($('#tmpl-whitelist-table').html()); $(this.el).html($('#tmpl-whitelist-table').html());
var _self = this;
_.each(this.model.models, function (whiteList) { _.each(this.model.models, function (whiteList) {
// look up client // look up client
@ -87,7 +89,9 @@ var WhiteListListView = Backbone.View.extend({
// if there's no client ID, this is an error! // if there's no client ID, this is an error!
if (client != null) { 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); }, this);
@ -175,15 +179,15 @@ var WhiteListView = Backbone.View.extend({
e.preventDefault(); e.preventDefault();
if (confirm("Are you sure you want to delete this whitelist entry?")) { if (confirm("Are you sure you want to delete this whitelist entry?")) {
var self = this; var _self = this;
this.model.destroy({ this.model.destroy({
success:function () { 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).slideUp("fast", function () { //slide up
$(this).remove(); //then remove from the DOM $(this).remove(); //then remove from the DOM
// check the placeholder in case it's empty now // 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; return false;