1
0
Fork 0

ui - fixed some event issues

This commit is contained in:
hkernbach 2017-03-21 12:26:20 +01:00
parent ec0e5e39a7
commit 2381e2a798
4 changed files with 42 additions and 10 deletions

View File

@ -33,7 +33,7 @@
'graphs/:name': 'showGraph',
'users': 'userManagement',
'user/:name': 'userView',
'user/:name/permission': 'userPermissionView',
'user/:name/permission': 'userPermission',
'userProfile': 'userProfile',
'cluster': 'cluster',
'nodes': 'nodes',
@ -515,11 +515,12 @@
return;
}
var callback = function () {
if (!this.hasOwnProperty('applicationDetailView')) {
this.applicationDetailView = new window.ApplicationDetailView({
model: this.foxxList.get(decodeURIComponent(mount))
});
if (this.hasOwnProperty('applicationDetailView')) {
this.applicationDetailView.remove();
}
this.applicationDetailView = new window.ApplicationDetailView({
model: this.foxxList.get(decodeURIComponent(mount))
});
this.applicationDetailView.model = this.foxxList.get(decodeURIComponent(mount));
this.applicationDetailView.render('swagger');
@ -933,14 +934,19 @@
}
},
userPermissionView: function (name, initialized) {
userPermission: function (name, initialized) {
this.checkUser();
if (initialized || initialized === null) {
if (this.userPermissionView) {
this.userPermissionView.remove();
}
this.userPermissionView = new window.UserPermissionView({
collection: this.userCollection,
databases: this.arangoDatabase,
username: name
});
this.userPermissionView.render();
} else if (initialized === false) {
this.waitForInit(this.userPermissionView.bind(this), name);
@ -967,11 +973,13 @@
this.waitForInit(this.userManagement.bind(this));
return;
}
if (!this.userManagementView) {
this.userManagementView = new window.UserManagementView({
collection: this.userCollection
});
if (this.userManagementView) {
this.userManagementView.remove();
}
this.userManagementView = new window.UserManagementView({
collection: this.userCollection
});
this.userManagementView.render();
},

View File

@ -11,6 +11,14 @@
template: templateEngine.createTemplate('applicationDetailView.ejs'),
remove: function () {
this.$el.empty().off(); /* off to unbind the events */
this.stopListening();
this.unbind();
delete this.el;
return this;
},
events: {
'click .open': 'openApp',
'click .delete': 'deleteApp',

View File

@ -10,6 +10,14 @@
template: templateEngine.createTemplate('userManagementView.ejs'),
remove: function () {
this.$el.empty().off(); /* off to unbind the events */
this.stopListening();
this.unbind();
delete this.el;
return this;
},
events: {
'click #createUser': 'createUser',
'click #submitCreateUser': 'submitCreateUser',

View File

@ -14,6 +14,14 @@
this.username = options.username;
},
remove: function () {
this.$el.empty().off(); /* off to unbind the events */
this.stopListening();
this.unbind();
delete this.el;
return this;
},
events: {
'click #userPermissionView [type="checkbox"]': 'setPermission'
},