Skip to content

Instantly share code, notes, and snippets.

@tonycoz
Created February 6, 2012 03:05
Show Gist options
  • Save tonycoz/1749287 to your computer and use it in GitHub Desktop.
Save tonycoz/1749287 to your computer and use it in GitHub Desktop.
You have:
options = Object.extend(Object.extend({ }, options));
options = {
openClass: options.openClass ? options.openClass : "open",
disclosureWidgetClass: options.disclosureWidgetClass ? options.disclosureWidgetClass : "disclosure-widget",
disclosureEvent: options.disclosureEvent ? options.disclosureEvent : "click"
}
Should be:
var defaults = {
openClass: "open",
disclosureWidgetClass: "disclosure-widget",
disclosureEvent: "click"
};
options = Object.extend(Object.extend({}, defaults), options || { });
or:
options = Object.extend({
openClass: "open",
disclosureWidgetClass: "disclosure-widget",
disclosureEvent: "click"
}, options || { });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment