mirror of https://gitee.com/bigwinds/arangodb
ui - fixed some event issues
This commit is contained in:
parent
ec0e5e39a7
commit
2381e2a798
|
@ -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();
|
||||
},
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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'
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue