Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge the default's settings with user's when array or object #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions jquery.ui.timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1080,9 +1080,22 @@
},

/* Get a setting value, defaulting if necessary. */
_get: function (inst, name) {
return inst.settings[name] !== undefined ?
inst.settings[name] : this._defaults[name];
/**
* AB Modification
* Merge the default's settings with user's when array or object
* NOTE: Simply returns the user property when string/integer/other
**/
_get: function (inst, name) {
var userProp = inst.settings[name];
if (userProp !== undefined) {
if (($.type(userProp) == 'array') || ($.type(userProp) == 'object')) {
return $.extend(true,this._defaults[name], userProp);
} else {
return userProp;
}
} else {
return this._defaults[name];
}
},

/* Parse existing time and initialise time picker. */
Expand Down