pixelmatrix/uniform — Issue #206: Default values being overwritten
Author: philodox
Created: 2012-01-20 20:01:35+00:00
State: open

I'm using uniform to initialize multiple select box styles, but I've encountered an issue where the default values are being overwritten. The issue occurs like this:

$("select.splitButton").uniform({"selectClass":"splitButton"}); // using custom styles
$("select.simple").uniform(); // using default styles

The "simple" select object is receiving the "splitButton" styles. This is because the defaults are being overwritten by options since the defaults are defined externally from the plug-in and are not reset each time the plug-in runs.

options = $.extend($.uniform.options, options); // first object is being extended by second object and then stored in options variable, but $.uniform.options has been altered for the next time the plug-in runs.

Suggested update:

options = $.extend({}, $.uniform.options, options); // a new empty object will be created based on defaults and options without altering the default settings