Skip to content
This repository was archived by the owner on May 26, 2025. It is now read-only.

Commit a938e3a

Browse files
committed
bugfix Model and Model.Store
1 parent f099e72 commit a938e3a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

model/store/store.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ $.Class('jQuery.Model.Store',
4444
}*/
4545
},
4646
// this is mostly unnecessary
47-
remove : function(id){
48-
if(id.id !== undefined){
49-
id = id.id;
47+
remove : function(ev,id){
48+
var idProp = this.id;
49+
if(id[idProp] !== undefined){
50+
id = id[idProp];
5051
}
5152
var item = this.data[id];
5253
if(!item){
@@ -389,4 +390,4 @@ $.Class('jQuery.Model.Store',
389390
},{});
390391

391392

392-
});
393+
});

model/store/store_test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ test("Store Remove", function(){
135135
list.bind("remove", function(ev, items){
136136
ok(items[0] === first, "removed first item");
137137
equals(list.length, len - 1, "length adjusted")
138+
var list2 = Item.Store.findAll({parentId: 1});
139+
ok(list2.get(first.id)[0] === undefined, "Model Store remove callback");
138140
start();
139141
})
140142
});

0 commit comments

Comments
 (0)