/* prevent horizontal scrollbar */
overflow-x: hidden;
}
- /* IE 6 doesn't support max-height
- * we use height instead, but this forces the menu to always be this tall
- */
- * html .ui-autocomplete {
- height: 100px;
- }
</style>
<script src="../../external/requirejs/require.js"></script>
<script src="../bootstrap.js">
( function() {
"use strict";
-// Find the script element
-var scripts = document.getElementsByTagName( "script" );
-var script = scripts[ scripts.length - 1 ];
+var script = document.currentScript;
// Read the modules
var modules = script.getAttribute( "data-modules" );
width: 25px;
height: 25px;
box-shadow: 6px 5px 9px -9px black;
- -webkit-transform: rotate(45deg);
- -ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.arrow.top:after {
key = style[ len ];
camelKey = camelCase( key );
- // Support: IE <=11+
- // In IE, `option` elements may have different initial `option` colors.
- // They may initially all be transparent, but later the selected
- // option gets a blue background with white text; ignore it.
- if ( document.documentMode && elem.nodeName.toLowerCase() === "option" && (
- camelKey === "color" ||
- camelKey.indexOf( "Color" ) === camelKey.length - "Color".length
- ) ) {
- continue;
- }
-
if ( typeof style[ key ] === "string" ) {
styles[ camelKey ] = style[ key ];
}
if ( elem.addEventListener ) {
// Standards-based browsers
elem.addEventListener( type, fn, false );
- } else if ( elem.attachEvent ) {
- // support: IE <9
- elem.attachEvent( "on" + type, fn );
}
}
assert.ok( menu.is( ":visible" ), "menu is visible after delay" );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-
- // Blur must be async for IE to handle it properly
- setTimeout( function() {
- element.simulate( "blur" );
- } );
+ element.simulate( "blur" );
} );
} );
} );
"qunit",
"jquery",
"lib/helper",
- "ui/safe-active-element",
"ui/widgets/button"
], function( QUnit, $, helper ) {
"use strict";
element.trigger( "focus" );
setTimeout( function() {
- assert.equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" );
+ assert.equal( element[ 0 ], document.activeElement, "Button is focused" );
element.button( "disable" );
- assert.notEqual( element[ 0 ], $.ui.safeActiveElement( document ), "Button has had focus removed" );
+ assert.notEqual( element[ 0 ], document.activeElement, "Button has had focus removed" );
ready();
} );
} );
} );
QUnit.test( "Ensure checked after single click on checkbox label button", function( assert ) {
- var ready = assert.async();
assert.expect( 2 );
$( "#check2" ).checkboxradio().on( "change", function() {
assert.hasClasses( label, "ui-state-active" );
} );
- // Support: Opera
- // Opera doesn't trigger a change event when this is done synchronously.
- // This seems to be a side effect of another test, but until that can be
- // tracked down, this delay will have to do.
- setTimeout( function() {
- $( "#check2" ).checkboxradio( "widget" ).simulate( "click" );
- ready();
- } );
+ $( "#check2" ).checkboxradio( "widget" ).simulate( "click" );
} );
QUnit.test( "Handle form association via form attribute", function( assert ) {
"jquery",
"lib/common",
"lib/helper",
- "ui/form",
"ui/labels",
"ui/unique-id"
], function( QUnit, $, common, helper ) {
function testLabels( testType ) {
var labels = dom.find( "#test" ).labels();
var found = labels.map( function() {
-
- // Support: Core 1.9 Only
- // We use String.prototype.trim because core 1.9.x silently fails
- // when white space is present
return String.prototype.trim.call( $( this ).text() );
} ).get();
QUnit.test( name + this.id.replace( /_/g, " " ), function( assert ) {
var ready = assert.async();
assert.expect( 1 );
- var form = input._form();
+ var form = $( input.prop( "form" ) );
// If input has a form the value should reset to "" if not it should be "changed"
var value = form.length ? "" : "changed";
} );
}
- // TODO: figure out why this setTimeout is needed in IE,
- // it only is necessary when the previous baseStructure tests runs first
- // Support: IE
setTimeout( step1 );
} );
"ui/widgets/datepicker",
"ui/i18n/datepicker-fr",
"ui/i18n/datepicker-he",
- "ui/i18n/datepicker-zh-CN",
- "ui/ie"
+ "ui/i18n/datepicker-zh-CN"
], function( QUnit, $, testHelper ) {
"use strict";
assert.equal( $.datepicker._defaults.showOn, "focus", "Retain default showOn" );
} );
-( function() {
- var url = window.location.search;
- url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + 9 ) );
+QUnit.test( "invocation", function( assert ) {
+ var ready = assert.async();
+ var button, image,
+ body = $( "body" );
- // TODO: This test occassionally fails in IE in TestSwarm
- if ( $.ui.ie && url && url.indexOf( "http" ) === 0 ) {
- return;
- }
+ assert.expect( 29 );
- QUnit.test( "invocation", function( assert ) {
- var ready = assert.async();
- var button, image,
- isOldIE = $.ui.ie && ( !document.documentMode || document.documentMode < 9 ),
- body = $( "body" );
-
- assert.expect( isOldIE ? 25 : 29 );
-
- function step0() {
- var inp = testHelper.initNewInput(),
- dp = $( "#ui-datepicker-div" );
-
- button = inp.siblings( "button" );
- assert.ok( button.length === 0, "Focus - button absent" );
- image = inp.siblings( "img" );
- assert.ok( image.length === 0, "Focus - image absent" );
-
- testHelper.onFocus( inp, function() {
- assert.ok( dp.is( ":visible" ), "Focus - rendered on focus" );
- inp.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
- assert.ok( !dp.is( ":visible" ), "Focus - hidden on exit" );
- step1();
- } );
- }
+ function step0() {
+ var inp = testHelper.initNewInput(),
+ dp = $( "#ui-datepicker-div" );
- function step1() {
+ button = inp.siblings( "button" );
+ assert.ok( button.length === 0, "Focus - button absent" );
+ image = inp.siblings( "img" );
+ assert.ok( image.length === 0, "Focus - image absent" );
- var inp = testHelper.initNewInput(),
- dp = $( "#ui-datepicker-div" );
+ testHelper.onFocus( inp, function() {
+ assert.ok( dp.is( ":visible" ), "Focus - rendered on focus" );
+ inp.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
+ assert.ok( !dp.is( ":visible" ), "Focus - hidden on exit" );
+ step1();
+ } );
+ }
- testHelper.onFocus( inp, function() {
- assert.ok( dp.is( ":visible" ), "Focus - rendered on focus" );
- body.simulate( "mousedown", {} );
- assert.ok( !dp.is( ":visible" ), "Focus - hidden on external click" );
- inp.datepicker( "hide" ).datepicker( "destroy" );
+ function step1() {
- step2();
- } );
- }
+ var inp = testHelper.initNewInput(),
+ dp = $( "#ui-datepicker-div" );
- function step2() {
- var inp = testHelper.initNewInput( {
- showOn: "button",
- buttonText: "Popup"
- } ),
- dp = $( "#ui-datepicker-div" );
-
- assert.ok( !dp.is( ":visible" ), "Button - initially hidden" );
- button = inp.siblings( "button" );
- image = inp.siblings( "img" );
- assert.ok( button.length === 1, "Button - button present" );
- assert.ok( image.length === 0, "Button - image absent" );
- assert.equal( button.text(), "Popup", "Button - button text" );
-
- testHelper.onFocus( inp, function() {
- assert.ok( !dp.is( ":visible" ), "Button - not rendered on focus" );
- button.trigger( "click" );
- assert.ok( dp.is( ":visible" ), "Button - rendered on button click" );
- button.trigger( "click" );
- assert.ok( !dp.is( ":visible" ), "Button - hidden on second button click" );
- inp.datepicker( "hide" ).datepicker( "destroy" );
-
- step3();
- } );
- }
+ testHelper.onFocus( inp, function() {
+ assert.ok( dp.is( ":visible" ), "Focus - rendered on focus" );
+ body.simulate( "mousedown", {} );
+ assert.ok( !dp.is( ":visible" ), "Focus - hidden on external click" );
+ inp.datepicker( "hide" ).datepicker( "destroy" );
- function step3() {
- var inp = testHelper.initNewInput( {
- showOn: "button",
- buttonImageOnly: true,
- buttonImage: "images/calendar.gif",
- buttonText: "Cal"
- } ),
- dp = $( "#ui-datepicker-div" );
-
- assert.ok( !dp.is( ":visible" ), "Image button - initially hidden" );
- button = inp.siblings( "button" );
- assert.ok( button.length === 0, "Image button - button absent" );
- image = inp.siblings( "img" );
- assert.ok( image.length === 1, "Image button - image present" );
- assert.ok( /images\/calendar\.gif$/.test( image.attr( "src" ) ), "Image button - image source" );
- assert.equal( image.attr( "title" ), "Cal", "Image button - image text" );
-
- testHelper.onFocus( inp, function() {
- assert.ok( !dp.is( ":visible" ), "Image button - not rendered on focus" );
- image.trigger( "click" );
- assert.ok( dp.is( ":visible" ), "Image button - rendered on image click" );
- image.trigger( "click" );
- assert.ok( !dp.is( ":visible" ), "Image button - hidden on second image click" );
- inp.datepicker( "hide" ).datepicker( "destroy" );
-
- step4();
- } );
- }
+ step2();
+ } );
+ }
- function step4() {
- var inp = testHelper.initNewInput( {
- showOn: "both",
- buttonImage: "images/calendar.gif"
- } ),
- dp = $( "#ui-datepicker-div" );
-
- assert.ok( !dp.is( ":visible" ), "Both - initially hidden" );
- button = inp.siblings( "button" );
- assert.ok( button.length === 1, "Both - button present" );
- image = inp.siblings( "img" );
- assert.ok( image.length === 0, "Both - image absent" );
- image = button.children( "img" );
- assert.ok( image.length === 1, "Both - button image present" );
-
- // TODO: This test occasionally fails to focus in IE8 in BrowserStack
- if ( !isOldIE ) {
- testHelper.onFocus( inp, function() {
- assert.ok( dp.is( ":visible" ), "Both - rendered on focus" );
- body.simulate( "mousedown", {} );
- assert.ok( !dp.is( ":visible" ), "Both - hidden on external click" );
- button.trigger( "click" );
- assert.ok( dp.is( ":visible" ), "Both - rendered on button click" );
- button.trigger( "click" );
- assert.ok( !dp.is( ":visible" ), "Both - hidden on second button click" );
- inp.datepicker( "hide" ).datepicker( "destroy" );
-
- ready();
- } );
- } else {
- ready();
- }
- }
+ function step2() {
+ var inp = testHelper.initNewInput( {
+ showOn: "button",
+ buttonText: "Popup"
+ } ),
+ dp = $( "#ui-datepicker-div" );
+
+ assert.ok( !dp.is( ":visible" ), "Button - initially hidden" );
+ button = inp.siblings( "button" );
+ image = inp.siblings( "img" );
+ assert.ok( button.length === 1, "Button - button present" );
+ assert.ok( image.length === 0, "Button - image absent" );
+ assert.equal( button.text(), "Popup", "Button - button text" );
+
+ testHelper.onFocus( inp, function() {
+ assert.ok( !dp.is( ":visible" ), "Button - not rendered on focus" );
+ button.trigger( "click" );
+ assert.ok( dp.is( ":visible" ), "Button - rendered on button click" );
+ button.trigger( "click" );
+ assert.ok( !dp.is( ":visible" ), "Button - hidden on second button click" );
+ inp.datepicker( "hide" ).datepicker( "destroy" );
+
+ step3();
+ } );
+ }
- step0();
- } );
-} )();
+ function step3() {
+ var inp = testHelper.initNewInput( {
+ showOn: "button",
+ buttonImageOnly: true,
+ buttonImage: "images/calendar.gif",
+ buttonText: "Cal"
+ } ),
+ dp = $( "#ui-datepicker-div" );
+
+ assert.ok( !dp.is( ":visible" ), "Image button - initially hidden" );
+ button = inp.siblings( "button" );
+ assert.ok( button.length === 0, "Image button - button absent" );
+ image = inp.siblings( "img" );
+ assert.ok( image.length === 1, "Image button - image present" );
+ assert.ok( /images\/calendar\.gif$/.test( image.attr( "src" ) ), "Image button - image source" );
+ assert.equal( image.attr( "title" ), "Cal", "Image button - image text" );
+
+ testHelper.onFocus( inp, function() {
+ assert.ok( !dp.is( ":visible" ), "Image button - not rendered on focus" );
+ image.trigger( "click" );
+ assert.ok( dp.is( ":visible" ), "Image button - rendered on image click" );
+ image.trigger( "click" );
+ assert.ok( !dp.is( ":visible" ), "Image button - hidden on second image click" );
+ inp.datepicker( "hide" ).datepicker( "destroy" );
+
+ step4();
+ } );
+ }
+
+ function step4() {
+ var inp = testHelper.initNewInput( {
+ showOn: "both",
+ buttonImage: "images/calendar.gif"
+ } ),
+ dp = $( "#ui-datepicker-div" );
+
+ assert.ok( !dp.is( ":visible" ), "Both - initially hidden" );
+ button = inp.siblings( "button" );
+ assert.ok( button.length === 1, "Both - button present" );
+ image = inp.siblings( "img" );
+ assert.ok( image.length === 0, "Both - image absent" );
+ image = button.children( "img" );
+ assert.ok( image.length === 1, "Both - button image present" );
+
+ testHelper.onFocus( inp, function() {
+ assert.ok( dp.is( ":visible" ), "Both - rendered on focus" );
+ body.simulate( "mousedown", {} );
+ assert.ok( !dp.is( ":visible" ), "Both - hidden on external click" );
+ button.trigger( "click" );
+ assert.ok( dp.is( ":visible" ), "Both - rendered on button click" );
+ button.trigger( "click" );
+ assert.ok( !dp.is( ":visible" ), "Both - hidden on second button click" );
+ inp.datepicker( "hide" ).datepicker( "destroy" );
+
+ ready();
+ } );
+ }
+
+ step0();
+} );
QUnit.test( "otherMonths", function( assert ) {
assert.expect( 8 );
};
function checkFocus( markup, options, testFn, next ) {
-
- // Support: IE8
- // For some reason the focus doesn't get set properly if we don't
- // focus the body first.
- $( "body" ).trigger( "focus" );
-
element = $( markup ).dialog( options );
setTimeout( function() {
testFn( function done() {
checkFocus( "<div><input><input></div>", options, function( done ) {
var input = element.find( "input" ).last().trigger( "focus" ).trigger( "blur" );
- // Support: IE 11+
- // In IE in jQuery 3.4+ a sequence:
- // $( inputNode ).trigger( "focus" ).trigger( "blur" ).trigger( "focus" )
- // doesn't end up with a focused input. See:
- // https://github.com/jquery/jquery/issues/4856
- // However, in this test we only want to check that the last focused
- // input receives the focus back when `_focusTabbable()` is called
- // which in reality doesn't happen so quickly so let's avoid the issue
- // by waiting a bit.
- if ( document.documentMode ) {
- setTimeout( function() {
- focusTabbableAndAssert();
- }, 500 );
- } else {
- focusTabbableAndAssert();
- }
-
- function focusTabbableAndAssert() {
- element.dialog( "instance" )._focusTabbable();
- setTimeout( function() {
- assert.equal( document.activeElement, input[ 0 ],
- "1. an element that was focused previously." );
- done();
- } );
- }
+ element.dialog( "instance" )._focusTabbable();
+ setTimeout( function() {
+ assert.equal( document.activeElement, input[ 0 ],
+ "1. an element that was focused previously." );
+ done();
+ } );
}, step2 );
}
second = $( "<div><input id='input-2'></div>" ).testWidget(),
secondInput = second.find( "input" );
- // Support: IE8
- // For some reason the focus doesn't get set properly if we don't
- // focus the body first.
- $( "body" ).trigger( "focus" );
-
// Wait for the modal to init
setTimeout( function() {
}
} );
- // Support: IE8
- // For some reason the #favorite-animal input doesn't get focus if we don't
- // focus the body first, causing the test to hang.
- $( "body" ).trigger( "focus" );
-
$( "#favorite-animal" )
// We focus the input to start the test. Once it receives focus, the
} );
offsetAfter = el.offset();
- // Support: FF, Chrome, and IE9,
- // there are some rounding errors in so we can't say equal, we have to settle for close enough
+ // Support: Firefox, Chrome
+ // There are some rounding errors, so we can't say equal, we have to settle for close enough
assert.close( offsetBefore.left, offsetAfter.left - 50, 1, "dragged[50, 50] " + "<" + typeName + "> left" );
assert.close( offsetBefore.top, offsetAfter.top - 50, 1, "dragged[50, 50] " + "<" + typeName + "> top" );
el.draggable( "destroy" );
// In IE8, when content is placed under the mouse (e.g. when draggable content is replaced
// on mousedown), mousemove is triggered on those elements even though the mouse hasn't moved.
- // Support: IE <9
element.on( "mousedown", function() {
$( document ).simulate( "mousemove", { button: -1 } );
} );
var element = $( "#draggable2" ).draggable( { handle: "span" } ),
focusElement = $( "<div tabindex='1'></div>" ).appendTo( element );
- // Mock $.ui.safeBlur with a spy
- var _safeBlur = $.ui.safeBlur;
+ // Mock $.ui.trigger with a spy
+ var _trigger = $.fn.trigger;
var blurCalledCount = 0;
- $.ui.safeBlur = function() {
- blurCalledCount++;
+ $.fn.trigger = function( eventName ) {
+ if ( eventName === "blur" ) {
+ blurCalledCount++;
+ }
};
testHelper.onFocus( focusElement, function() {
testHelper.move( element.find( "span" ), 1, 1 );
assert.strictEqual( blurCalledCount, 1, "draggable blurs when mousing down on handle" );
- // Restore safeBlur
- $.ui.safeBlur = _safeBlur;
+ // Restore trigger
+ $.fn.trigger = _trigger;
ready();
} );
assert.hasClasses( child, "ui-draggable-handle", "child retains class name on destroy" );
} );
-// Support: IE 8 only
-// IE 8 implements DOM Level 2 Events which only has events bubble up to the document.
-// We skip this test since it would be impossible for it to pass in such an environment.
-QUnit[ document.documentMode === 8 ? "skip" : "test" ](
- "does not stop propagation to window",
- function( assert ) {
- assert.expect( 1 );
- var element = $( "#draggable1" ).draggable();
+QUnit.test( "does not stop propagation to window", function( assert ) {
+ assert.expect( 1 );
+ var element = $( "#draggable1" ).draggable();
- var handler = function() {
- assert.ok( true, "mouseup propagates to window" );
- };
- $( window ).on( "mouseup", handler );
+ var handler = function() {
+ assert.ok( true, "mouseup propagates to window" );
+ };
+ $( window ).on( "mouseup", handler );
- element.simulate( "drag", {
- dx: 10,
- dy: 10
- } );
+ element.simulate( "drag", {
+ dx: 10,
+ dy: 10
+ } );
- $( window ).off( "mouseup", handler );
- }
-);
+ $( window ).off( "mouseup", handler );
+} );
} );
return $.extend( helper, {
- // TODO: remove the unreliable offset hacks
- unreliableOffset: $.ui.ie && ( !document.documentMode || document.documentMode < 8 ) ? 2 : 0,
-
testDragPosition: function( assert, el, dx, dy, expectedDX, expectedDY, msg ) {
msg = msg ? msg + "." : "";
assert.equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" );
assert.equal( ui.position.top - ui.originalPosition.top, deltaY, testName + " " + position + " top" );
} else if ( testData.cursorAt.right ) {
- assert.equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x - testHelper.unreliableOffset, testName + " " + position + " left" );
- assert.equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y - testHelper.unreliableOffset, testName + " " + position + " top" );
+ assert.equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x, testName + " " + position + " left" );
+ assert.equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y, testName + " " + position + " top" );
} else {
- assert.equal( event.clientX - ui.offset.left, testData.x + testHelper.unreliableOffset, testName + " " + position + " left" );
- assert.equal( event.clientY - ui.offset.top, testData.y + testHelper.unreliableOffset, testName + " " + position + " top" );
+ assert.equal( event.clientX - ui.offset.left, testData.x, testName + " " + position + " left" );
+ assert.equal( event.clientY - ui.offset.top, testData.y, testName + " " + position + " top" );
}
}
} );
assert.equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" );
assert.equal( ui.position.top - ui.originalPosition.top, deltaY, testName + " " + position + " top" );
} else if ( testData.cursorAt.right ) {
- assert.equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x - testHelper.unreliableOffset, testName + " " + position + " left" );
- assert.equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y - testHelper.unreliableOffset, testName + " " + position + " top" );
+ assert.equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x, testName + " " + position + " left" );
+ assert.equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y, testName + " " + position + " top" );
} else {
- assert.equal( event.clientX - ui.offset.left, testData.x + testHelper.unreliableOffset, testName + " " + position + " left" );
- assert.equal( event.clientY - ui.offset.top, testData.y + testHelper.unreliableOffset, testName + " " + position + " top" );
+ assert.equal( event.clientX - ui.offset.left, testData.x, testName + " " + position + " left" );
+ assert.equal( event.clientY - ui.offset.top, testData.y, testName + " " + position + " top" );
}
}
} );
dy: 1300
} );
- // IE8 natively scrolls when dragging an element inside a overflow:hidden
- // container, so skip this test if native scroll occurs.
- // Support: IE <9
- if ( scrollParent.scrollTop() > 0 ) {
- assert.ok( true, "overflow:hidden container natively scrolls" );
- assert.ok( true, "overflow:hidden container natively scrolls" );
- return;
- }
-
element.css( { top: 0, left: 0 } ).draggable( "option", "scroll", true );
element.simulate( "drag", {
} );
QUnit.test( "iframeFix", function( assert ) {
- assert.expect( 6 );
+ assert.expect( 5 );
var element = $( "<div>" ).appendTo( "#qunit-fixture" ).draggable( { iframeFix: true } ),
element2 = $( "<div>" ).appendTo( "#qunit-fixture" ).draggable( { iframeFix: ".iframe" } ),
} );
element.one( "drag", function() {
- var divOffset, iframeOffset,
- div = $( this ).children().not( "iframe" );
+ var div = $( this ).children().not( "iframe" );
// https://bugs.jqueryui.com/ticket/9671
// iframeFix doesn't handle iframes that move
assert.equal( div.outerWidth(), iframe.outerWidth(), "blocking div is wide enough" );
assert.equal( div.outerHeight(), iframe.outerHeight(), "blocking div is tall enough" );
- divOffset = div.offset();
- iframeOffset = iframe.offset();
-
- // Support: Edge <79 only
- // In Edge Legacy these values differ a little.
- assert.ok( Math.abs( divOffset.top - iframeOffset.top ) < 0.25, "Check top within 0.25 of expected" );
- assert.ok( Math.abs( divOffset.left - iframeOffset.left ) < 0.25, "Check left within 0.25 of expected" );
+ assert.deepEqual( div.offset(), iframe.offset(), "blocking div is tall enough" );
} );
element.simulate( "drag", {
QUnit.test( "handle blur", function( assert ) {
var ready = assert.async();
assert.expect( 2 );
- var blurHandled = false,
- index = 1,
+ var index = 1,
element = $( "#menu1" ).menu( {
blur: function( event, ui ) {
-
- // Ignore duplicate blur event fired by IE
- if ( !blurHandled ) {
- blurHandled = true;
- assert.equal( event.type, "menublur", "blur event.type is 'menublur'" );
- assert.strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" );
- }
+ assert.equal( event.type, "menublur", "blur event.type is 'menublur'" );
+ assert.strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" );
}
} );
QUnit.test( "handle blur via click outside", function( assert ) {
var ready = assert.async();
assert.expect( 2 );
- var blurHandled = false,
- index = 1,
+ var index = 1,
element = $( "#menu1" ).menu( {
blur: function( event, ui ) {
-
- // Ignore duplicate blur event fired by IE
- if ( !blurHandled ) {
- blurHandled = true;
- assert.equal( event.type, "menublur", "blur event.type is 'menublur'" );
- assert.strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" );
- }
+ assert.equal( event.type, "menublur", "blur event.type is 'menublur'" );
+ assert.strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" );
}
} );
placeholder: "test",
forcePlaceholderSize: true,
start: function( event, ui ) {
-
- // Support: IE 11+, Edge <79 only
- // In IE & Edge Legacy these values may differ a little
- // when jQuery >=3.0 <3.2 is used.
- if ( jqMinor === "3.0." || jqMinor === "3.1." ) {
- assert.ok( Math.abs( ui.placeholder.height() - ui.item.height() ) < 0.25,
- "placeholder height is within 0.25 px of item's" );
- } else {
- assert.equal( ui.placeholder.height(), ui.item.height(),
- "placeholder is same height as item" );
- }
+ assert.equal( ui.placeholder.height(), ui.item.height(),
+ "placeholder is same height as item" );
}
} );
assert.deepEqual( superOptions, {}, "Base implementation returns empty object" );
- // Support: IE8
- // Strict equality fails when comparing this.window in ie8
- assert.equal( this.window[ 0 ], window, "this.window is properly defined" );
+ assert.strictEqual( this.window[ 0 ], window, "this.window is properly defined" );
assert.strictEqual( this.document[ 0 ], document, "this.document is properly defined" );
return {
vertical-align: middle;
text-align: center;
-webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
user-select: none;
-
- /* Support: IE <= 11 */
- overflow: visible;
}
.ui-button,
}
/* workarounds */
-/* Support: Firefox 5 - 40 */
+/* Support: Firefox 5 - 125+ */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
/* Spinner specific style fixes */
.ui-controlgroup-vertical .ui-spinner-input {
-
- /* Support: IE8 only, Android < 4.4 only */
- width: 75%;
width: calc( 100% - 2.4em );
}
.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
left: 0;
position: absolute;
opacity: 0;
- -ms-filter: "alpha(opacity=0)"; /* support: IE8 */
}
.ui-front {
* https://jquery.org/license
*/
.ui-draggable-handle {
- -ms-touch-action: none;
touch-action: none;
}
.ui-menu .ui-menu-item {
margin: 0;
cursor: pointer;
- /* support: IE10, see #8844 */
- list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
}
.ui-menu .ui-menu-item-wrapper {
position: relative;
.ui-progressbar .ui-progressbar-overlay {
background: url("data:image/gif;base64,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");
height: 100%;
- -ms-filter: "alpha(opacity=25)"; /* support: IE8 */
opacity: 0.25;
}
.ui-progressbar-indeterminate .ui-progressbar-value {
position: absolute;
font-size: 0.1px;
display: block;
- -ms-touch-action: none;
touch-action: none;
}
.ui-resizable-disabled .ui-resizable-handle,
* https://jquery.org/license
*/
.ui-selectable {
- -ms-touch-action: none;
touch-action: none;
}
.ui-selectable-helper {
width: 1.2em;
height: 1.2em;
cursor: pointer;
- -ms-touch-action: none;
touch-action: none;
}
.ui-slider .ui-slider-range {
background-position: 0 0;
}
-/* support: IE8 - See #6727 */
-.ui-slider.ui-state-disabled .ui-slider-handle,
-.ui-slider.ui-state-disabled .ui-slider-range {
- filter: inherit;
-}
-
.ui-slider-horizontal {
height: .8em;
}
* https://jquery.org/license
*/
.ui-sortable-handle {
- -ms-touch-action: none;
touch-action: none;
}
.ui-widget-content .ui-priority-secondary,
.ui-widget-header .ui-priority-secondary {
opacity: .7;
- -ms-filter: "alpha(opacity=70)"; /* support: IE8 */
font-weight: normal;
}
.ui-state-disabled,
.ui-widget-content .ui-state-disabled,
.ui-widget-header .ui-state-disabled {
opacity: .35;
- -ms-filter: "alpha(opacity=35)"; /* support: IE8 */
background-image: none;
}
-.ui-state-disabled .ui-icon {
- -ms-filter: "alpha(opacity=35)"; /* support: IE8 - See #6059 */
-}
/* Icons
----------------------------------*/
.ui-widget-overlay {
background: #aaaaaa/*{bgColorOverlay}*/ /*{bgImgUrlOverlay}*/ /*{bgOverlayXPos}*/ /*{bgOverlayYPos}*/ /*{bgOverlayRepeat}*/;
opacity: .3/*{opacityOverlay}*/;
- -ms-filter: "alpha(opacity=30)"/*{opacityFilterOverlay}*/; /* support: IE8 */
}
.ui-widget-shadow {
- -webkit-box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/;
box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/;
}
"./data",
"./disable-selection",
"./focusable",
- "./form",
- "./ie",
"./keycode",
"./labels",
"./jquery-patch",
"./plugin",
- "./safe-active-element",
- "./safe-blur",
"./scroll-parent",
"./tabbable",
"./unique-id",
function getElementStyles( elem ) {
var key, len,
- style = elem.ownerDocument.defaultView ?
- elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
- elem.currentStyle,
+ style = elem.ownerDocument.defaultView.getComputedStyle( elem ),
styles = {};
- if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
- len = style.length;
- while ( len-- ) {
- key = style[ len ];
- if ( typeof style[ key ] === "string" ) {
- styles[ camelCase( key ) ] = style[ key ];
- }
- }
-
- // Support: Opera, IE <9
- } else {
- for ( key in style ) {
- if ( typeof style[ key ] === "string" ) {
- styles[ key ] = style[ key ];
- }
+ len = style.length;
+ while ( len-- ) {
+ key = style[ len ];
+ if ( typeof style[ key ] === "string" ) {
+ styles[ camelCase( key ) ] = style[ key ];
}
}
focusableIfVisible = hasTabindex;
}
- return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) );
+ return focusableIfVisible && $( element ).is( ":visible" ) &&
+ $( element ).css( "visibility" ) === "visible";
};
-// Support: IE 8 only
-// IE 8 doesn't resolve inherit to visible/hidden for computed values
-function visible( element ) {
- var visibility = element.css( "visibility" );
- while ( visibility === "inherit" ) {
- element = element.parent();
- visibility = element.css( "visibility" );
- }
- return visibility === "visible";
-}
-
$.extend( $.expr.pseudos, {
focusable: function( element ) {
return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
// AMD. Register as an anonymous module.
define( [
"jquery",
- "./form",
"./version"
], factory );
} else {
},
_bindFormResetHandler: function() {
- this.form = this.element._form();
+ this.form = $( this.element.prop( "form" ) );
if ( !this.form.length ) {
return;
}
+++ /dev/null
-( function( factory ) {
- "use strict";
-
- if ( typeof define === "function" && define.amd ) {
-
- // AMD. Register as an anonymous module.
- define( [ "jquery", "./version" ], factory );
- } else {
-
- // Browser globals
- factory( jQuery );
- }
-} )( function( $ ) {
-"use strict";
-
-// Support: IE8 Only
-// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
-// with a string, so we need to find the proper form.
-return $.fn._form = function() {
- return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
-};
-
-} );
+++ /dev/null
-( function( factory ) {
- "use strict";
-
- if ( typeof define === "function" && define.amd ) {
-
- // AMD. Register as an anonymous module.
- define( [ "jquery", "./version" ], factory );
- } else {
-
- // Browser globals
- factory( jQuery );
- }
-} )( function( $ ) {
-"use strict";
-
-// This file is deprecated
-return $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
-} );
return this.pushStack( this[ 0 ].labels );
}
- // Support: IE <= 11, FF <= 37, Android <= 2.3 only
- // Above browsers do not support control.labels. Everything below is to support them
- // as well as document fragments. control.labels does not work on document fragments
+ // If `control.labels` is empty - e.g. inside of document fragments - find
+ // the labels manually
labels = this.eq( 0 ).parents( "label" );
// Look for the label based on the id
+++ /dev/null
-( function( factory ) {
- "use strict";
-
- if ( typeof define === "function" && define.amd ) {
-
- // AMD. Register as an anonymous module.
- define( [ "jquery", "./version" ], factory );
- } else {
-
- // Browser globals
- factory( jQuery );
- }
-} )( function( $ ) {
-"use strict";
-
-return $.ui.safeActiveElement = function( document ) {
- var activeElement;
-
- // Support: IE 9 only
- // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
- try {
- activeElement = document.activeElement;
- } catch ( error ) {
- activeElement = document.body;
- }
-
- // Support: IE 9 - 11 only
- // IE may return null instead of an element
- // Interestingly, this only seems to occur when NOT in an iframe
- if ( !activeElement ) {
- activeElement = document.body;
- }
-
- // Support: IE 11 only
- // IE11 returns a seemingly empty object in some cases when accessing
- // document.activeElement from an <iframe>
- if ( !activeElement.nodeName ) {
- activeElement = document.body;
- }
-
- return activeElement;
-};
-
-} );
+++ /dev/null
-( function( factory ) {
- "use strict";
-
- if ( typeof define === "function" && define.amd ) {
-
- // AMD. Register as an anonymous module.
- define( [ "jquery", "./version" ], factory );
- } else {
-
- // Browser globals
- factory( jQuery );
- }
-} )( function( $ ) {
-"use strict";
-
-return $.ui.safeBlur = function( element ) {
-
- // Support: IE9 - 10 only
- // If the <body> is blurred, IE will switch windows, see #9420
- if ( element && element.nodeName.toLowerCase() !== "body" ) {
- $( element ).trigger( "blur" );
- }
-};
-
-} );
this._super( value );
this.element.attr( "aria-disabled", value );
-
- // Support: IE8 Only
- // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
- // so we need to add the disabled class to the headers and panels
this._toggleClass( null, "ui-state-disabled", !!value );
- this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
- !!value );
},
_keydown: function( event ) {
this._removeClass( prev, "ui-accordion-header-active" )
._addClass( prev, "ui-accordion-header-collapsed" );
- // Work around for rendering bug in IE (#5421)
- if ( toHide.length ) {
- toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
- }
this._trigger( "activate", null, data );
}
} );
"./menu",
"../keycode",
"../position",
- "../safe-active-element",
"../version",
"../widget"
], factory );
// Textareas are always multi-line
// Inputs are always single-line, even if inside a contentEditable element
- // IE also treats inputs as contentEditable
- // All other element types are determined by whether or not they're contentEditable
- this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );
+ // All other element types are determined by whether they're contentEditable
+ this.isMultiLine = isTextarea ||
+ !isInput && this.element.prop( "contentEditable" ) === "true";
this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
this.isNewMenu = true;
// Different browsers have different default behavior for escape
// Single press can mean undo or clear
- // Double press in IE means clear the whole form
event.preventDefault();
}
break;
role: null
} )
.hide()
-
- // Support: IE 11 only, Edge <= 14
- // For other browsers, we preventDefault() on the mousedown event
- // to keep the dropdown from taking focus from the input. This doesn't
- // work for IE/Edge, causing problems with selection and scrolling (#9638)
- // Happily, IE and Edge support an "unselectable" attribute that
- // prevents an element from receiving focus, exactly what we want here.
- .attr( {
- "unselectable": "on"
- } )
.menu( "instance" );
this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
menufocus: function( event, ui ) {
var label, item;
- // support: Firefox
+ // Support: Firefox
// Prevent accidental activation of menu items in Firefox (#7024 #9118)
if ( this.isNewMenu ) {
this.isNewMenu = false;
previous = this.previous;
// Only trigger when focus was lost (click on menu)
- if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
+ if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
this.element.trigger( "focus" );
this.previous = previous;
-
- // #6109 - IE triggers two focus events and the second
- // is asynchronous, so we need to reset the previous
- // term synchronously and asynchronously :-(
- this._delay( function() {
- this.previous = previous;
- this.selectedItem = item;
- } );
}
if ( false !== this._trigger( "select", event, { item: item } ) ) {
// Prevents moving cursor to beginning/end of the text field in some browsers
event.preventDefault();
}
- },
-
- // Support: Chrome <=50
- // We should be able to just use this.element.prop( "isContentEditable" )
- // but hidden elements always report false in Chrome.
- // https://code.google.com/p/chromium/issues/detail?id=313082
- _isContentEditable: function( element ) {
- if ( !element.length ) {
- return false;
- }
-
- var editable = element.prop( "contentEditable" );
-
- if ( editable === "inherit" ) {
- return this._isContentEditable( element.parent() );
- }
-
- return editable === "true";
}
} );
if ( event.keyCode === $.ui.keyCode.SPACE ) {
event.preventDefault();
- // Support: PhantomJS <= 1.9, IE 8 Only
- // If a native click is available use it so we actually cause navigation
- // otherwise just trigger a click event
+ // If a native click is available use it, so we
+ // actually cause navigation. Otherwise, just trigger
+ // a click event.
if ( this.element[ 0 ].click ) {
this.element[ 0 ].click();
} else {
// Not inside a form, check all inputs that also are not inside a form
group = $( nameSelector ).filter( function() {
- return $( this )._form().length === 0;
+ return $( $( this ).prop( "form" ) ).length === 0;
} );
}
"../focusable",
"../keycode",
"../position",
- "../safe-active-element",
- "../safe-blur",
"../tabbable",
"../unique-id",
"../version",
// Hiding a focused element doesn't trigger blur in WebKit
// so in case we have nothing to focus on, explicitly blur the active element
// https://bugs.webkit.org/show_bug.cgi?id=47182
- $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );
+ $( this.document[ 0 ].activeElement ).trigger( "blur" );
}
this._hide( this.uiDialog, this.options.hide, function() {
}
this._isOpen = true;
- this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
+ this.opener = $( this.document[ 0 ].activeElement );
this._size();
this._position();
},
_restoreTabbableFocus: function() {
- var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
+ var activeElement = this.document[ 0 ].activeElement,
isActive = this.uiDialog[ 0 ] === activeElement ||
$.contains( this.uiDialog[ 0 ], activeElement );
if ( !isActive ) {
_keepFocus: function( event ) {
event.preventDefault();
this._restoreTabbableFocus();
-
- // support: IE
- // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
- // so we check again later
- this._delay( this._restoreTabbableFocus );
},
_createWrapper: function() {
}
} );
- // Support: IE
- // Use type="button" to prevent enter keypresses in textboxes from closing the
- // dialog in IE (#9312)
this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
.button( {
label: $( "<a>" ).text( this.options.closeText ).html(),
"./mouse",
"../data",
"../plugin",
- "../safe-active-element",
- "../safe-blur",
"../scroll-parent",
"../version",
"../widget"
},
_blurActiveElement: function( event ) {
- var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
+ var activeElement = this.document[ 0 ].activeElement,
target = $( event.target );
// Don't blur if the event occurred on an element that is within
}
// Blur any element that currently has focus, see #4261
- $.ui.safeBlur( activeElement );
+ $( activeElement ).trigger( "blur" );
},
_mouseStart: function( event ) {
"jquery",
"../keycode",
"../position",
- "../safe-active-element",
"../unique-id",
"../version",
"../widget"
},
"click .ui-menu-item": function( event ) {
var target = $( event.target );
- var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
+ var active = $( this.document[ 0 ].activeElement );
if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
this.select( event );
this._delay( function() {
var notContained = !$.contains(
this.element[ 0 ],
- $.ui.safeActiveElement( this.document[ 0 ] )
+ this.document[ 0 ].activeElement
);
if ( notContained ) {
this.collapseAll( event );
// AMD. Register as an anonymous module.
define( [
"jquery",
- "../ie",
"../version",
"../widget"
], factory );
this._mouseDownEvent = event;
var that = this,
- btnIsLeft = ( event.which === 1 ),
-
- // event.target.nodeName works around a bug in IE 8 with
- // disabled inputs (#7620)
- elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
- $( event.target ).closest( this.options.cancel ).length : false );
+ btnIsLeft = event.which === 1,
+ elIsCancel = typeof this.options.cancel === "string" ?
+ $( event.target ).closest( this.options.cancel ).length :
+ false;
if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
return true;
}
_mouseMove: function( event ) {
// Only check for mouseups outside the document if you've moved inside the document
- // at least once. This prevents the firing of mouseup in the case of IE<9, which will
- // fire a mousemove event if content is placed under the cursor. See #7778
- // Support: IE <9
- if ( this._mouseMoved ) {
-
- // IE mouseup check - mouseup happened when mouse was out of window
- if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
- !event.button ) {
+ // at least once.
+ if ( this._mouseMoved && !event.which ) {
+
+ // Support: Safari <=8 - 9
+ // Safari sets which to 0 if you press any of the following keys
+ // during a drag (#14461)
+ if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
+ event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
+ this.ignoreMissingWhich = true;
+ } else if ( !this.ignoreMissingWhich ) {
return this._mouseUp( event );
-
- // Iframe mouseup check - mouseup occurred in another document
- } else if ( !event.which ) {
-
- // Support: Safari <=8 - 9
- // Safari sets which to 0 if you press any of the following keys
- // during a drag (#14461)
- if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
- event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
- this.ignoreMissingWhich = true;
- } else if ( !this.ignoreMissingWhich ) {
- return this._mouseUp( event );
- }
}
}
};
this.element.css( margins );
- this.originalElement.css( "margin", 0 );
- // support: Safari
+ // Support: Safari
// Prevent Safari textarea resize
this.originalResizeStyle = this.originalElement.css( "resize" );
this.originalElement.css( "resize", "none" );
display: "block"
} ) );
- // Support: IE9
- // avoid IE jump (hard set the margin)
- this.originalElement.css( margins );
-
this._proportionallyResize();
}
role: "listbox",
select: function( event, ui ) {
event.preventDefault();
-
- // Support: IE8
- // If the item was selected via a click, the text selection
- // will be destroyed in IE
- that._setSelection();
-
that._select( ui.item.data( "ui-selectmenu-item" ), event );
},
focus: function( event, ui ) {
return;
}
- if ( window.getSelection ) {
- selection = window.getSelection();
- selection.removeAllRanges();
- selection.addRange( this.range );
-
- // Support: IE8
- } else {
- this.range.select();
- }
-
- // Support: IE
- // Setting the text selection kills the button focus in IE, but
- // restoring the focus doesn't kill the selection.
- this.button.trigger( "focus" );
+ selection = window.getSelection();
+ selection.removeAllRanges();
+ selection.addRange( this.range );
},
_documentClick: {
// Prevent text selection from being reset when interacting with the selectmenu (#10144)
mousedown: function() {
- var selection;
-
- if ( window.getSelection ) {
- selection = window.getSelection();
- if ( selection.rangeCount ) {
- this.range = selection.getRangeAt( 0 );
- }
-
- // Support: IE8
- } else {
- this.range = document.selection.createRange();
+ var selection = window.getSelection();
+ if ( selection.rangeCount ) {
+ this.range = selection.getRangeAt( 0 );
}
},
_resizeMenu: function() {
this.menu.outerWidth( Math.max(
this.button.outerWidth(),
-
- // Support: IE10
- // IE10 wraps long text (possibly a rounding bug)
- // so we add 1px to avoid the wrapping
- this.menu.width( "" ).outerWidth() + 1
+ this.menu.width( "" ).outerWidth()
) );
},
"jquery",
"./mouse",
"../data",
- "../ie",
"../scroll-parent",
"../version",
"../widget"
if ( o.cursor && o.cursor !== "auto" ) { // cursor option
body = this.document.find( "body" );
- // Support: IE
- this.storedCursor = body.css( "cursor" );
- body.css( "cursor", o.cursor );
-
this.storedStylesheet =
$( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
}
po.top += this.scrollParent.scrollTop();
}
- // This needs to be actually done for all browsers, since pageX/pageY includes this
- // information with an ugly IE fix
- if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
- ( this.offsetParent[ 0 ].tagName &&
- this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
+ // This needs to be actually done for all browsers, since pageX/pageY includes
+ // this information.
+ if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ) {
po = { top: 0, left: 0 };
}
}
//Do what was originally in plugins
- if ( this.storedCursor ) {
- this.document.find( "body" ).css( "cursor", this.storedCursor );
+ if ( this.storedStylesheet ) {
this.storedStylesheet.remove();
}
if ( this._storedOpacity ) {
"./button",
"../version",
"../keycode",
- "../safe-active-element",
"../widget"
], factory );
} else {
this.previous = this.element.val();
},
blur: function( event ) {
- if ( this.cancelBlur ) {
- delete this.cancelBlur;
- return;
- }
-
this._stop();
this._refresh();
if ( this.previous !== this.element.val() ) {
}
},
mousewheel: function( event, delta ) {
- var activeElement = $.ui.safeActiveElement( this.document[ 0 ] );
+ var activeElement = this.document[ 0 ].activeElement;
var isActive = this.element[ 0 ] === activeElement;
if ( !isActive || !delta ) {
// If the input is focused then this.previous is properly set from
// when the input first received focus. If the input is not focused
// then we need to set this.previous based on the value before spinning.
- previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ?
+ previous = this.element[ 0 ] === this.document[ 0 ].activeElement ?
this.previous : this.element.val();
function checkFocus() {
- var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] );
+ var isActive = this.element[ 0 ] === this.document[ 0 ].activeElement;
if ( !isActive ) {
this.element.trigger( "focus" );
this.previous = previous;
-
- // support: IE
- // IE sets focus asynchronously, so we need to check if focus
- // moved off of the input because the user clicked on the button.
- this._delay( function() {
- this.previous = previous;
- } );
}
}
event.preventDefault();
checkFocus.call( this );
- // Support: IE
- // IE doesn't prevent moving focus even with event.preventDefault()
- // so we set a flag to know when we should ignore the blur event
- // and check (again) if focus moved off of the input.
- this.cancelBlur = true;
- this._delay( function() {
- delete this.cancelBlur;
- checkFocus.call( this );
- } );
-
if ( this._start( event ) === false ) {
return;
}
define( [
"jquery",
"../keycode",
- "../safe-active-element",
"../unique-id",
"../version",
"../widget"
},
_tabKeydown: function( event ) {
- var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ),
+ var focusedTab = $( this.document[ 0 ].activeElement ).closest( "li" ),
selectedIndex = this.tabs.index( focusedTab ),
goingForward = true;
if ( $( this ).is( ".ui-state-disabled" ) ) {
event.preventDefault();
}
- } )
-
- // Support: IE <9
- // Preventing the default action in mousedown doesn't prevent IE
- // from focusing the element, so if the anchor gets focused, blur.
- // We don't have to worry about focusing the previously focused
- // element since clicking on a non-focusable element should focus
- // the body anyway.
- .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() {
- if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
- this.blur();
- }
} );
this.tabs = this.tablist.find( "> li:has(a[href])" )
_ajaxSettings: function( anchor, event, eventData ) {
var that = this;
return {
-
- // Support: IE <11 only
- // Strip any hash that exists to prevent errors with the Ajax request
- url: anchor.attr( "href" ).replace( /#.*$/, "" ),
+ url: anchor.attr( "href" ),
beforeSend: function( jqXHR, settings ) {
return that._trigger( "beforeLoad", event,
$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
content = contentOption.call( target[ 0 ], function( response ) {
- // IE may instantly serve a cached response for ajax requests
- // delay this call to _open so the other call to _open runs first
- that._delay( function() {
-
- // Ignore async response if tooltip was closed already
- if ( !target.data( "ui-tooltip-open" ) ) {
- return;
- }
+ // Ignore async response if tooltip was closed already
+ if ( !target.data( "ui-tooltip-open" ) ) {
+ return;
+ }
- // JQuery creates a special event for focusin when it doesn't
- // exist natively. To improve performance, the native event
- // object is reused and the type is changed. Therefore, we can't
- // rely on the type being correct after the event finished
- // bubbling, so we set it back to the previous value. (#8740)
- if ( event ) {
- event.type = eventType;
- }
- this._open( event, target, response );
- } );
+ // JQuery creates a special event for focusin when it doesn't
+ // exist natively. To improve performance, the native event
+ // object is reused and the type is changed. Therefore, we can't
+ // rely on the type being correct after the event finished
+ // bubbling, so we set it back to the previous value. (#8740)
+ if ( event ) {
+ event.type = eventType;
+ }
+ that._open( event, target, response );
} );
if ( content ) {
this._open( event, target, content );