Skip to content

Commit

Permalink
Changed the Sammy.Store KVO to send an object instead of multiple arg…
Browse files Browse the repository at this point in the history
…uments [Thanks dpree!]

This makes Sammy.Store better conform with Sammy.Application#bind and #trigger
The object sent looks like {key: key, value:value}
  • Loading branch information
quirkey committed Feb 25, 2010
1 parent cfcc03d commit 16f0e38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/sammy.storage.js
Expand Up @@ -96,7 +96,7 @@
this.storage.set(key, string_value);
if (key != this.meta_key) {
this._addKey(key);
this.$element.trigger('set-' + this.name + '.' + key, [key, value]);
this.$element.trigger('set-' + this.name + '.' + key, {key: key, value: value});
};
return string_value;
},
Expand Down
4 changes: 2 additions & 2 deletions test/test_sammy_storage.js
Expand Up @@ -79,8 +79,8 @@
})
.should('fire events on get and set', function() {
var fired = false;
$('#main').bind('set-test_store.foo', function(e, key, value) {
fired = value;
$('#main').bind('set-test_store.foo', function(e, data) {
fired = data.value;
});
this.store.set('foo', 'bar');
soon(function() {
Expand Down

0 comments on commit 16f0e38

Please sign in to comment.