Skip to content
Permalink
Browse files

Core: Remove .zIndex()

Fixes #9156
  • Loading branch information
scottgonzalez committed Oct 20, 2014
1 parent 89ed68f commit faf87d992455280182edef015c8733313744a739
Showing with 0 additions and 187 deletions.
  1. +0 −1 build/tasks/testswarm.js
  2. +0 −1 tests/unit/all.html
  3. +0 −132 tests/unit/core/core_deprecated.html
  4. +0 −24 tests/unit/core/core_deprecated.js
  5. +0 −29 ui/core.js
@@ -15,7 +15,6 @@ var versions = {
"Autocomplete": "autocomplete/autocomplete.html",
"Button": "button/button.html",
"Core": "core/core.html",
"Core_deprecated": "core/core_deprecated.html",
"Datepicker": "datepicker/datepicker.html",
"Dialog": "dialog/dialog.html",
"Draggable": "draggable/draggable.html",
@@ -20,7 +20,6 @@
"autocomplete/autocomplete.html",
"button/button.html",
"core/core.html",
"core/core_deprecated.html",
"datepicker/datepicker.html",
"dialog/dialog.html",
"draggable/draggable.html",

This file was deleted.

This file was deleted.

@@ -223,35 +223,6 @@ $.fn.extend({

enableSelection: function() {
return this.unbind( ".ui-disableSelection" );
},

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;
}
});

3 comments on commit faf87d9

@CBenni

This comment has been minimized.

Copy link

@CBenni CBenni replied Nov 15, 2015

Why was the getter method removed as well? Isnt it useful to have a helper like that? (I would need it in this piece of code im porting over from jquery-ui 1.4)

@scottgonzalez

This comment has been minimized.

Copy link
Member Author

@scottgonzalez scottgonzalez replied Nov 15, 2015

Why was the getter method removed as well? Isnt it useful to have a helper like that?

This is explained in the 1.11 upgrade guide when the method was deprecated. See http://jqueryui.com/upgrade-guide/1.11/#deprecated-zindex

(I would need it in this piece of code im porting over from jquery-ui 1.4)

I'm not sure which version you're actually upgrading from, and I'm not sure why you would need the method since you haven't provided any details. However, this method is not going to come back as we have no use for it and think that manually managing z-index is generally a bad idea.

@CBenni

This comment has been minimized.

Copy link

@CBenni CBenni replied Nov 15, 2015

This codepen explains what im doing: sortable ignores z-index http://codepen.io/anon/pen/EVraOL

I found an old solution where it added a compareZIndex option, which worked fine. I am quite sure this is of no relevance to the community, which is why I will refrain from submitting a PR, but I was wondering why the .zIndex getter was removed - it allows more fine-tuning than just a general .ui-front
For now, I have fixed it by adding the method as _zIndex() inside the custom extended sortable class.

best regards.

Please sign in to comment.
You can’t perform that action at this time.