Datepicker: fixed #5679 #543

Closed
wants to merge 2 commits into
from
@@ -1793,10 +1793,14 @@ $.fn.datepicker = function(options){
/* Initialise the date picker. */
if (!$.datepicker.initialized) {
- $(document).mousedown($.datepicker._checkExternalClick).
- find('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) {
+ $(document).find('body').append($.datepicker.dpDiv);
+ }
var otherArgs = Array.prototype.slice.call(arguments, 1);
if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget'))