Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
focus now uses lower-level zIndex property instead of .css() for perf…
Browse files Browse the repository at this point in the history
…ormance boost
  • Loading branch information
Craga89 committed Dec 9, 2010
1 parent b917872 commit 03f48f3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Wed Dec 8 22:46:23 2010 +0000
* Date: Wed Dec 8 23:03:11 2010 +0000
*/

.ui-tooltip-accessible{
Expand Down
10 changes: 5 additions & 5 deletions dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Wed Dec 8 22:46:23 2010 +0000
* Date: Wed Dec 8 23:03:11 2010 +0000
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -947,7 +947,7 @@ function QTip(target, options, id)

var tooltip = self.elements.tooltip,
qtips = $(selector),
curIndex = parseInt(tooltip.css('z-index'), 10),
curIndex = parseInt(tooltip[0].style.zIndex, 10),
newIndex = $.fn.qtip.zindex + qtips.length,
focusClass = uitooltip + '-focus',
cachedEvent = $.extend({}, event),
Expand All @@ -957,8 +957,8 @@ function QTip(target, options, id)
if(!tooltip.hasClass(focusClass) && curIndex !== newIndex)
{
// Reduce our z-index's and keep them properly ordered
qtips.css('z-index', function(i, curIndex) {
return curIndex - 1;
qtips.each(function() {
this.style.zIndex = this.style.zIndex - 1;
});

// Fire blur event for focussed tooltip
Expand All @@ -983,7 +983,7 @@ function QTip(target, options, id)

// Set the new z-index and set focus status to TRUE if callback wasn't FALSE
if(!callback.isDefaultPrevented()) {
tooltip.css({ zIndex: newIndex }).addClass(focusClass);
tooltip.addClass(focusClass)[0].style.zIndex = newIndex;
}
}

Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.qtip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/jquery.qtip.pack.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/core.js
Expand Up @@ -922,7 +922,7 @@ function QTip(target, options, id)

var tooltip = self.elements.tooltip,
qtips = $(selector),
curIndex = parseInt(tooltip.css('z-index'), 10),
curIndex = parseInt(tooltip[0].style.zIndex, 10),
newIndex = $.fn.qtip.zindex + qtips.length,
focusClass = uitooltip + '-focus',
cachedEvent = $.extend({}, event),
Expand All @@ -932,8 +932,8 @@ function QTip(target, options, id)
if(!tooltip.hasClass(focusClass) && curIndex !== newIndex)
{
// Reduce our z-index's and keep them properly ordered
qtips.css('z-index', function(i, curIndex) {
return curIndex - 1;
qtips.each(function() {
this.style.zIndex = this.style.zIndex - 1;
});

// Fire blur event for focussed tooltip
Expand All @@ -958,7 +958,7 @@ function QTip(target, options, id)

// Set the new z-index and set focus status to TRUE if callback wasn't FALSE
if(!callback.isDefaultPrevented()) {
tooltip.css({ zIndex: newIndex }).addClass(focusClass);
tooltip.addClass(focusClass)[0].style.zIndex = newIndex;
}
}

Expand Down

0 comments on commit 03f48f3

Please sign in to comment.