1
0
Fork 0

Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel

This commit is contained in:
Frank Celler 2013-03-28 09:53:37 +01:00
commit a6d06b9976
3 changed files with 16 additions and 6 deletions

View File

@ -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;

View File

@ -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();
}
});

View File

@ -140,9 +140,6 @@ var collectionsView = Backbone.View.extend({
// search executed
this.search();
},
details: function () {
}
});