diff options
author | Felix Nagel <info@felixnagel.com> | 2012-08-11 19:45:43 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-08-11 19:45:43 +0200 |
commit | dd272e75689a7e105f7d852f0fc903e4f4bda245 (patch) | |
tree | 5c097bc4ce4ab3ead310c63ac228bb1f0d3683b6 /ui/jquery.ui.datepicker.js | |
parent | 549b97ed6cc718087ce8b9bff3c8556ab4ca7848 (diff) | |
parent | 30b579f598a3abdc9b0b7ad18bc76c8b5438d5ca (diff) | |
download | jquery-ui-dd272e75689a7e105f7d852f0fc903e4f4bda245.tar.gz jquery-ui-dd272e75689a7e105f7d852f0fc903e4f4bda245.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r-- | ui/jquery.ui.datepicker.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 06db79ba7..cd4ffe3ee 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -3,7 +3,7 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker @@ -309,7 +309,7 @@ $.extend(Datepicker.prototype, { this.uuid += 1; var id = 'dp' + this.uuid; this._dialogInput = $('<input type="text" id="' + id + - '" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'); + '" style="position: absolute; top: -100px; width: 0px;"/>'); this._dialogInput.keydown(this._doKeyDown); $('body').append(this._dialogInput); inst = this._dialogInst = this._newInst(this._dialogInput, false); @@ -708,6 +708,9 @@ $.extend(Datepicker.prototype, { /* Generate the date picker content. */ _updateDatepicker: function(inst) { + if ($.datepicker._curInst && inst != $.datepicker._curInst) { + return; + } this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) var borders = $.datepicker._getBorders(inst.dpDiv); instActive = inst; // for delegate hover events @@ -763,8 +766,8 @@ $.extend(Datepicker.prototype, { var dpHeight = inst.dpDiv.outerHeight(); var inputWidth = inst.input ? inst.input.outerWidth() : 0; var inputHeight = inst.input ? inst.input.outerHeight() : 0; - var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); - var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); + var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()); + var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; @@ -1411,7 +1414,7 @@ $.extend(Datepicker.prototype, { */ _attachHandlers: function(inst) { var stepMonths = this._get(inst, 'stepMonths'); - var id = '#' + inst.id; + var id = '#' + inst.id.replace( /\\\\/g, "\\" ); inst.dpDiv.find('[data-handler]').map(function () { var handler = { prev: function () { @@ -1815,7 +1818,7 @@ $.fn.datepicker = function(options){ /* Initialise the date picker. */ if (!$.datepicker.initialized) { $(document).mousedown($.datepicker._checkExternalClick). - find('body').append($.datepicker.dpDiv); + find(document.body).append($.datepicker.dpDiv); $.datepicker.initialized = true; } |