diff options
author | Roman Salnikov <bardt.dz@gmail.com> | 2012-11-19 09:14:59 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-11-19 09:15:10 -0500 |
commit | 7ffcaa2e3b673e7e4178293224d5a15f65cbbcf9 (patch) | |
tree | e80345e7d8cc065e60d095009b56bf67660d87d4 /ui/jquery.ui.datepicker.js | |
parent | cf9fbce13931732dc4b06d491ef2a01c4921faf1 (diff) | |
download | jquery-ui-7ffcaa2e3b673e7e4178293224d5a15f65cbbcf9.tar.gz jquery-ui-7ffcaa2e3b673e7e4178293224d5a15f65cbbcf9.zip |
Datepicker: reinitialize datepicker if mainDiv isn't on the page. Fixed #5679 - Datepicker should reinitialize if dpDiv is removed
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r-- | ui/jquery.ui.datepicker.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 584f21aaa..823934e05 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -2023,11 +2023,15 @@ $.fn.datepicker = function(options){ /* Initialise the date picker. */ if (!$.datepicker.initialized) { - $(document).mousedown($.datepicker._checkExternalClick). - find(document.body).append($.datepicker.dpDiv); + $(document).mousedown($.datepicker._checkExternalClick); $.datepicker.initialized = true; } + /* Append datepicker main container to body if not exist. */ + if ($("#"+$.datepicker._mainDivId).length === 0) { + $('body').append($.datepicker.dpDiv); + } + var otherArgs = Array.prototype.slice.call(arguments, 1); if (typeof options === 'string' && (options === 'isDisabled' || options === 'getDate' || options === 'widget')) { return $.datepicker['_' + options + 'Datepicker']. |