Datepicker: Removed iframe cover for IE6.

This commit is contained in:
Scott González 2012-10-26 15:59:29 -04:00
parent d73edfff76
commit 5bd19650a3
3 changed files with 10 additions and 39 deletions

View File

@ -43,15 +43,14 @@ test("widget method", function() {
}); });
test('baseStructure', function() { test('baseStructure', function() {
expect( 59 ); expect( 58 );
var header, title, table, thead, week, panel, inl, child, var header, title, table, thead, week, panel, inl, child,
inp = init('#inp').focus(), inp = init('#inp').focus(),
dp = $('#ui-datepicker-div'), dp = $('#ui-datepicker-div');
iframe = ($.ui.ie6);
ok(dp.is(':visible'), 'Structure - datepicker visible'); ok(dp.is(':visible'), 'Structure - datepicker visible');
ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left'); ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left');
ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month'); ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month');
equal(dp.children().length, 2 + (iframe ? 1 : 0), 'Structure - child count'); equal(dp.children().length, 2, 'Structure - child count');
header = dp.children(':first'); header = dp.children(':first');
ok(header.is('div.ui-datepicker-header'), 'Structure - header division'); ok(header.is('div.ui-datepicker-header'), 'Structure - header division');
@ -78,7 +77,6 @@ test('baseStructure', function() {
equal(week.children().length, 7, 'Structure - week child count'); equal(week.children().length, 7, 'Structure - week child count');
ok(week.children(':first').is('td.ui-datepicker-week-end'), 'Structure - month table first day cell'); ok(week.children(':first').is('td.ui-datepicker-week-end'), 'Structure - month table first day cell');
ok(week.children(':last').is('td.ui-datepicker-week-end'), 'Structure - month table second day cell'); ok(week.children(':last').is('td.ui-datepicker-week-end'), 'Structure - month table second day cell');
ok(dp.children('iframe').length === (iframe ? 1 : 0), 'Structure - iframe');
inp.datepicker('hide').datepicker('destroy'); inp.datepicker('hide').datepicker('destroy');
// Editable month/year and button panel // Editable month/year and button panel
@ -100,7 +98,7 @@ test('baseStructure', function() {
inp = init('#inp', {numberOfMonths: 2}); inp = init('#inp', {numberOfMonths: 2});
inp.focus(); inp.focus();
ok(dp.is('.ui-datepicker-multi'), 'Structure multi [2] - multi-month'); ok(dp.is('.ui-datepicker-multi'), 'Structure multi [2] - multi-month');
equal(dp.children().length, 3 + (iframe ? 1 : 0), 'Structure multi [2] - child count'); equal(dp.children().length, 3, 'Structure multi [2] - child count');
child = dp.children(':first'); child = dp.children(':first');
ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2] - first month division'); ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2] - first month division');
child = dp.children(':eq(1)'); child = dp.children(':eq(1)');
@ -121,7 +119,7 @@ test('baseStructure', function() {
inp = init('#inp', {numberOfMonths: [2, 2]}); inp = init('#inp', {numberOfMonths: [2, 2]});
inp.focus(); inp.focus();
ok(dp.is('.ui-datepicker-multi'), 'Structure multi - multi-month'); ok(dp.is('.ui-datepicker-multi'), 'Structure multi - multi-month');
equal(dp.children().length, 6 + (iframe ? 1 : 0), 'Structure multi [2,2] - child count'); equal(dp.children().length, 6, 'Structure multi [2,2] - child count');
child = dp.children(':first'); child = dp.children(':first');
ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2,2] - first month division'); ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2,2] - first month division');
child = dp.children(':eq(1)'); child = dp.children(':eq(1)');
@ -156,7 +154,7 @@ test('baseStructure', function() {
inl = init('#inl', {numberOfMonths: 2}); inl = init('#inl', {numberOfMonths: 2});
dp = inl.children(); dp = inl.children();
ok(dp.is('.ui-datepicker-inline') && dp.is('.ui-datepicker-multi'), 'Structure inline multi - main div'); ok(dp.is('.ui-datepicker-inline') && dp.is('.ui-datepicker-multi'), 'Structure inline multi - main div');
equal(dp.children().length, 3 + (iframe ? 1 : 0), 'Structure inline multi - child count'); equal(dp.children().length, 3, 'Structure inline multi - child count');
child = dp.children(':first'); child = dp.children(':first');
ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure inline multi - first month division'); ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure inline multi - first month division');
child = dp.children(':eq(1)'); child = dp.children(':eq(1)');
@ -168,13 +166,12 @@ test('baseStructure', function() {
test('customStructure', function() { test('customStructure', function() {
expect( 20 ); expect( 20 );
var iframe, header, panel, title, thead, var header, panel, title, thead,
dp = $('#ui-datepicker-div'), dp = $('#ui-datepicker-div'),
// Check right-to-left localisation // Check right-to-left localisation
inp = init('#inp', $.datepicker.regional.he); inp = init('#inp', $.datepicker.regional.he);
inp.data('showButtonPanel.datepicker',true); inp.data('showButtonPanel.datepicker',true);
inp.focus(); inp.focus();
iframe = ($.ui.ie6);
ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left'); ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left');
header = dp.children(':first'); header = dp.children(':first');
ok(header.is('div.ui-datepicker-header'), 'Structure RTL - header division'); ok(header.is('div.ui-datepicker-header'), 'Structure RTL - header division');

View File

@ -54,14 +54,3 @@
.ui-datepicker-rtl .ui-datepicker-group { float:right; } .ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}

View File

@ -682,23 +682,13 @@ $.extend(Datepicker.prototype, {
if (!inst.inline) { if (!inst.inline) {
var showAnim = $.datepicker._get(inst, 'showAnim'); var showAnim = $.datepicker._get(inst, 'showAnim');
var duration = $.datepicker._get(inst, 'duration'); var duration = $.datepicker._get(inst, 'duration');
var postProcess = function() {
var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
if( !! cover.length ){
var borders = $.datepicker._getBorders(inst.dpDiv);
cover.css({left: -borders[0], top: -borders[1],
width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});
}
};
inst.dpDiv.zIndex($(input).zIndex()+1); inst.dpDiv.zIndex($(input).zIndex()+1);
$.datepicker._datepickerShowing = true; $.datepicker._datepickerShowing = true;
if ( $.effects && $.effects.effect[ showAnim ] ) if ( $.effects && $.effects.effect[ showAnim ] )
inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration);
else else
inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); inst.dpDiv[showAnim || 'show'](showAnim ? duration : null);
if (!showAnim || !duration)
postProcess();
if (inst.input.is(':visible') && !inst.input.is(':disabled')) if (inst.input.is(':visible') && !inst.input.is(':disabled'))
inst.input.focus(); inst.input.focus();
$.datepicker._curInst = inst; $.datepicker._curInst = inst;
@ -712,10 +702,6 @@ $.extend(Datepicker.prototype, {
instActive = inst; // for delegate hover events instActive = inst; // for delegate hover events
inst.dpDiv.empty().append(this._generateHTML(inst)); inst.dpDiv.empty().append(this._generateHTML(inst));
this._attachHandlers(inst); this._attachHandlers(inst);
var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6
cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
}
inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover(); inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover();
var numMonths = this._getNumberOfMonths(inst); var numMonths = this._getNumberOfMonths(inst);
var cols = numMonths[1]; var cols = numMonths[1];
@ -1604,8 +1590,7 @@ $.extend(Datepicker.prototype, {
} }
html += group; html += group;
} }
html += buttonPanel + ($.ui.ie6 && !inst.inline ? html += buttonPanel;
'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
inst._keyEvent = false; inst._keyEvent = false;
return html; return html;
}, },