Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
+ moved plugin zIndex from previous version
  • Loading branch information
kirmorozov committed Apr 5, 2018
1 parent f9069b9 commit c4c93aa
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lib/web/jquery/jquery-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,39 @@ $.ui = $.ui || {};

var version = $.ui.version = "1.12.1";

// plugins
$.fn.extend({
zIndex: function( zIndex ) {
if ( zIndex !== undefined ) {
return this.css( "zIndex", zIndex );
}

if ( this.length ) {
var elem = $( this[ 0 ] ), position, value;
while ( elem.length && elem[ 0 ] !== document ) {
// Ignore z-index if position is set to a value where z-index is ignored by the browser
// This makes behavior of this function consistent across browsers
// WebKit always returns auto if the element is positioned
position = elem.css( "position" );
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
// IE returns 0 when zIndex is not specified
// other browsers return a string
// we ignore the case of nested elements with an explicit value of 0
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
value = parseInt( elem.css( "zIndex" ), 10 );
if ( !isNaN( value ) && value !== 0 ) {
return value;
}
}
elem = elem.parent();
}
}

return 0;
}

});

/*!
* jQuery UI Widget 1.12.1
* http://jqueryui.com
Expand Down

0 comments on commit c4c93aa

Please sign in to comment.