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;
|
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) {
|
getProperties: function (id) {
|
||||||
var data2;
|
var data2;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -213,6 +225,7 @@ window.arangoCollections = Backbone.Collection.extend({
|
||||||
},
|
},
|
||||||
deleteCollection: function (id) {
|
deleteCollection: function (id) {
|
||||||
var returnval = false;
|
var returnval = false;
|
||||||
|
var self = this;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
cache: false,
|
cache: false,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -220,6 +233,8 @@ window.arangoCollections = Backbone.Collection.extend({
|
||||||
async: false,
|
async: false,
|
||||||
success: function () {
|
success: function () {
|
||||||
returnval = true;
|
returnval = true;
|
||||||
|
self.remove(self.getByName(id));
|
||||||
|
window.collectionsView.render();
|
||||||
},
|
},
|
||||||
error: function () {
|
error: function () {
|
||||||
returnval = false;
|
returnval = false;
|
||||||
|
|
|
@ -135,14 +135,12 @@ var collectionView = Backbone.View.extend({
|
||||||
var collName = self.myCollection.name;
|
var collName = self.myCollection.name;
|
||||||
var returnval = window.arangoCollectionsStore.deleteCollection(collName);
|
var returnval = window.arangoCollectionsStore.deleteCollection(collName);
|
||||||
if (returnval === true) {
|
if (returnval === true) {
|
||||||
self.hideModal();
|
|
||||||
arangoHelper.arangoNotification('Collection deleted successfully.');
|
arangoHelper.arangoNotification('Collection deleted successfully.');
|
||||||
window.App.navigate("#");
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
arangoHelper.arangoError('Could not delete collection.');
|
arangoHelper.arangoError('Could not delete collection.');
|
||||||
self.hideModal();
|
|
||||||
}
|
}
|
||||||
|
self.hideModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -140,9 +140,6 @@ var collectionsView = Backbone.View.extend({
|
||||||
|
|
||||||
// search executed
|
// search executed
|
||||||
this.search();
|
this.search();
|
||||||
},
|
|
||||||
|
|
||||||
details: function () {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue