From 16f0e38d93744d9f5a3cbfa800c20d0a546a657d Mon Sep 17 00:00:00 2001 From: Aaron Quint Date: Wed, 24 Feb 2010 23:24:02 -0500 Subject: [PATCH] Changed the Sammy.Store KVO to send an object instead of multiple arguments [Thanks dpree!] This makes Sammy.Store better conform with Sammy.Application#bind and #trigger The object sent looks like {key: key, value:value} --- lib/plugins/sammy.storage.js | 2 +- test/test_sammy_storage.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/plugins/sammy.storage.js b/lib/plugins/sammy.storage.js index 729876f1..0544652f 100644 --- a/lib/plugins/sammy.storage.js +++ b/lib/plugins/sammy.storage.js @@ -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; }, diff --git a/test/test_sammy_storage.js b/test/test_sammy_storage.js index 9d50f62d..6eae20e0 100644 --- a/test/test_sammy_storage.js +++ b/test/test_sammy_storage.js @@ -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() {