Skip to content

Instantly share code, notes, and snippets.

@rmanalan
Created November 21, 2010 03:56
Show Gist options
  • Save rmanalan/708431 to your computer and use it in GitHub Desktop.
Save rmanalan/708431 to your computer and use it in GitHub Desktop.
$element is redefined... why?
Sammy.Store = function(options) {
var store = this;
this.options = options || {};
this.name = this.options.name || 'store';
this.element = this.options.element || 'body';
this.$element = $(this.element); // <== *** Why is $element redefined in this plugin? ***
if ($.isArray(this.options.type)) {
$.each(this.options.type, function(i, type) {
if (Sammy.Store.isAvailable(type)) {
store.type = type;
return false;
}
});
} else {
this.type = this.options.type || 'memory';
}
this.meta_key = this.options.meta_key || '__keys__';
this.storage = new Sammy.Store[Sammy.Store.stores[this.type]](this.name, this.element, this.options);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment