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

Commit

Permalink
Better border-radius detection for tips plugin. Made post-commit hook…
Browse files Browse the repository at this point in the history
… executable
  • Loading branch information
Craga89 committed Jul 28, 2012
1 parent 11fe3b1 commit deb07a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions dist/jquery.qtip.js
Expand Up @@ -2371,10 +2371,11 @@ function Tip(qTip, command)
elem = isTitleTop ? elems.titlebar : elems.content,
moz = $.browser.mozilla,
prefix = moz ? '-moz-' : $.browser.webkit ? '-webkit-' : '',
side = corner.y + (moz ? '' : '-') + corner.x,
css = prefix + (moz ? 'border-radius-' + side : 'border-' + side + '-radius');
nonStandard = 'border-radius-' + corner.y + corner.x,
standard = 'border-' + corner.y + '-' + corner.x + '-radius';

return parseInt(elem.css(css), 10) || parseInt(tooltip.css(css), 10) || 0;
function r(c) { console.log(c); return parseInt(elem.css(c), 10) || parseInt(tooltip.css(c), 10); }
return r(standard) || r(prefix + standard) || r(prefix + nonStandard) || r(nonStandard) || 0;
}

function calculateSize(corner) {
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.qtip.min.js

Large diffs are not rendered by default.

Empty file modified hooks/post-commit 100644 → 100755
Empty file.
7 changes: 4 additions & 3 deletions src/tips/tips.js
Expand Up @@ -206,10 +206,11 @@ function Tip(qTip, command)
elem = isTitleTop ? elems.titlebar : elems.content,
moz = $.browser.mozilla,
prefix = moz ? '-moz-' : $.browser.webkit ? '-webkit-' : '',
side = corner.y + (moz ? '' : '-') + corner.x,
css = prefix + (moz ? 'border-radius-' + side : 'border-' + side + '-radius');
nonStandard = 'border-radius-' + corner.y + corner.x,
standard = 'border-' + corner.y + '-' + corner.x + '-radius';

return parseInt(elem.css(css), 10) || parseInt(tooltip.css(css), 10) || 0;
function r(c) { console.log(c); return parseInt(elem.css(c), 10) || parseInt(tooltip.css(c), 10); }
return r(standard) || r(prefix + standard) || r(prefix + nonStandard) || r(nonStandard) || 0;
}

function calculateSize(corner) {
Expand Down

0 comments on commit deb07a7

Please sign in to comment.