mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
a6d06b9976
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -140,9 +140,6 @@ var collectionsView = Backbone.View.extend({
|
|||
|
||||
// search executed
|
||||
this.search();
|
||||
},
|
||||
|
||||
details: function () {
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue