Created
November 21, 2010 03:56
-
-
Save rmanalan/708431 to your computer and use it in GitHub Desktop.
$element is redefined... why?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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