1
0
Fork 0

Frontend: Replaced Jans findWhere replacement with the correct function, which is available after update of backbone

This commit is contained in:
Michael Hackstein 2013-03-28 09:54:56 +01:00
parent 10f4a0f488
commit b458b0e233
1 changed files with 1 additions and 13 deletions

View File

@ -116,18 +116,6 @@ 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({
@ -233,7 +221,7 @@ window.arangoCollections = Backbone.Collection.extend({
async: false, async: false,
success: function () { success: function () {
returnval = true; returnval = true;
self.remove(self.getByName(id)); self.remove(self.findWhere({name: id}));
window.collectionsView.render(); window.collectionsView.render();
}, },
error: function () { error: function () {