Permalink
Browse files

Fix tip height/width consistency when changing tooltip position

  • Loading branch information...
1 parent 7f13a0a commit 970cfabacd0511feb516eb3b632f6cc2bfa337e2 @Craga89 Craga89 committed Apr 26, 2012
Showing with 48 additions and 6 deletions.
  1. +1 −1 dist/jquery.qtip.basic.js
  2. +1 −1 dist/jquery.qtip.css
  3. +22 −1 dist/jquery.qtip.js
  4. +3 −3 dist/jquery.qtip.min.js
  5. +21 −0 src/tips/tips.js
@@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
-* Date: Thu Apr 26 20:39:24 2012 +0100
+* Date: Thu Apr 26 20:40:09 2012 +0100
*/
/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
@@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
-* Date: Thu Apr 26 20:39:24 2012 +0100
+* Date: Thu Apr 26 20:40:09 2012 +0100
*/
/* Core qTip styles */
View
@@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
-* Date: Thu Apr 26 20:39:24 2012 +0100
+* Date: Thu Apr 26 20:40:09 2012 +0100
*/
/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
@@ -2785,6 +2785,17 @@ function Tip(qTip, command)
}
};
+ function swapDimensions() {
+ var temp = size.width;
+ size.width = size.height;
+ size.height = temp;
+ }
+
+ function resetDimensions() {
+ size.width = opts.width;
+ size.height = opts.height;
+ }
+
function reposition(event, api, pos, viewport) {
if(!elems.tip) { return; }
@@ -3083,6 +3094,16 @@ function Tip(qTip, command)
}
precedance = mimic.precedance;
+ // Ensure the tip width.height are relative to the tip position
+ if(corner.precedance === 'x') { swapDimensions(); }
+ else { resetDimensions(); }
+
+ // Set the tip dimensions
+ elems.tip.css({
+ width: (width = size.width),
+ height: (height = size.height)
+ });
+
// Update our colours
self.detectColours(corner);
Oops, something went wrong.
View
@@ -75,6 +75,17 @@ function Tip(qTip, command)
}
};
+ function swapDimensions() {
+ var temp = size.width;
+ size.width = size.height;
+ size.height = temp;
+ }
+
+ function resetDimensions() {
+ size.width = opts.width;
+ size.height = opts.height;
+ }
+
function reposition(event, api, pos, viewport) {
if(!elems.tip) { return; }
@@ -373,6 +384,16 @@ function Tip(qTip, command)
}
precedance = mimic.precedance;
+ // Ensure the tip width.height are relative to the tip position
+ if(corner.precedance === 'x') { swapDimensions(); }
+ else { resetDimensions(); }
+
+ // Set the tip dimensions
+ elems.tip.css({
+ width: (width = size.width),
+ height: (height = size.height)
+ });
+
// Update our colours
self.detectColours(corner);

0 comments on commit 970cfab

Please sign in to comment.