diff --git a/html/admin/js/collections/arangoCollections.js b/html/admin/js/collections/arangoCollections.js index 1c7adffd64..50f8b9de97 100644 --- a/html/admin/js/collections/arangoCollections.js +++ b/html/admin/js/collections/arangoCollections.js @@ -116,6 +116,18 @@ window.arangoCollections = Backbone.Collection.extend({ return result; }, + getByName: function (name) { + // some clumsy replacement for collection.findWhere() + var i; + + for (i = 0; i < this.models.length; ++i) { + if (this.models[i].get('name') === name) { + return this.models[i]; + } + } + return undefined; + }, + getProperties: function (id) { var data2; $.ajax({ @@ -213,6 +225,7 @@ window.arangoCollections = Backbone.Collection.extend({ }, deleteCollection: function (id) { var returnval = false; + var self = this; $.ajax({ cache: false, type: 'DELETE', @@ -220,6 +233,8 @@ window.arangoCollections = Backbone.Collection.extend({ async: false, success: function () { returnval = true; + self.remove(self.getByName(id)); + window.collectionsView.render(); }, error: function () { returnval = false; diff --git a/html/admin/js/views/collectionView.js b/html/admin/js/views/collectionView.js index 028cab3707..c6da8ce46f 100644 --- a/html/admin/js/views/collectionView.js +++ b/html/admin/js/views/collectionView.js @@ -135,14 +135,12 @@ var collectionView = Backbone.View.extend({ var collName = self.myCollection.name; var returnval = window.arangoCollectionsStore.deleteCollection(collName); if (returnval === true) { - self.hideModal(); arangoHelper.arangoNotification('Collection deleted successfully.'); - window.App.navigate("#"); } else { arangoHelper.arangoError('Could not delete collection.'); - self.hideModal(); } + self.hideModal(); } }); diff --git a/html/admin/js/views/collectionsView.js b/html/admin/js/views/collectionsView.js index 446f97d1e8..d5f455dda2 100644 --- a/html/admin/js/views/collectionsView.js +++ b/html/admin/js/views/collectionsView.js @@ -140,9 +140,6 @@ var collectionsView = Backbone.View.extend({ // search executed this.search(); - }, - - details: function () { } });