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

Commit

Permalink
Tooltips will no longer extend past the top.left window boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Aug 17, 2010
1 parent 51114a8 commit 609547f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 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: Mon Aug 16 21:31:56 2010 +0100
* Date: Tue Aug 17 01:03:37 2010 +0100
*/

.ui-tooltip-accessible{
Expand Down
6 changes: 5 additions & 1 deletion 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: Mon Aug 16 21:31:56 2010 +0100
* Date: Tue Aug 17 01:03:37 2010 +0100
*/

"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 @@ -958,6 +958,10 @@ function QTip(target, options, id)
position.adjusted = { left: 0, top: 0 };
}

// Make sure the tooltip doesn't extend the top/left window boundaries
if(position.top < 1) { position.top = 0; }
if(position.left < 1) { position.left = 0; }

// Set tooltip position class
tooltip.attr('class', function(i, val) {
return $(this).attr('class').replace(/ui-tooltip-pos-\w+/i, '');
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

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

0 comments on commit 609547f

Please sign in to comment.