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

Commit

Permalink
Library now correctly parses "center <x>" corners, which previously h…
Browse files Browse the repository at this point in the history
…ad to be wrote "<x> center"
  • Loading branch information
Craga89 committed Dec 6, 2010
1 parent cad7207 commit 1b132b9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 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 Dec 6 20:01:31 2010 +0000
* Date: Mon Dec 6 20:09:48 2010 +0000
*/

.ui-tooltip-accessible{
Expand Down
5 changes: 3 additions & 2 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: Mon Dec 6 20:01:31 2010 +0000
* Date: Mon Dec 6 20:09:48 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 @@ -1508,8 +1508,9 @@ $.fn.qtip.plugins = {
// Corner object parser
Corner: function(corner) {
corner = String(corner).replace(/([A-Z])/, ' $1').replace(/middle/gi, 'center').toLowerCase();
this.x = (corner.match(/left|right|center/i) || ['inherit'])[0].toLowerCase();
this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();

this.precedance = (corner.charAt(0).search(/^(t|b)/) > -1) ? 'y' : 'x';
this.string = function() { return this.precedance === 'y' ? this.y+this.x : this.x+this.y; };
this.abbreviation = function() {
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.

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

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/core.js
Expand Up @@ -1483,8 +1483,9 @@ $.fn.qtip.plugins = {
// Corner object parser
Corner: function(corner) {
corner = String(corner).replace(/([A-Z])/, ' $1').replace(/middle/gi, 'center').toLowerCase();
this.x = (corner.match(/left|right|center/i) || ['inherit'])[0].toLowerCase();
this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();

this.precedance = (corner.charAt(0).search(/^(t|b)/) > -1) ? 'y' : 'x';
this.string = function() { return this.precedance === 'y' ? this.y+this.x : this.x+this.y; };
this.abbreviation = function() {
Expand Down

0 comments on commit 1b132b9

Please sign in to comment.