Skip to content

Commit

Permalink
Merge pull request #19 from tirenatoanjos/patch-1
Browse files Browse the repository at this point in the history
## Update jquery.balloon.js
### Enhancement
- Added an option to specify the tip position by rate.
  • Loading branch information
urin committed Dec 24, 2015
2 parents 68b3bda + 1fda367 commit 7b1143b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jquery.balloon.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
if(m) {
balloon["set" + m.camel.pos.p1]
(balloon[m.pos.p1] + ((m.isTopLeft) ? 1 : -1) * (options.tipSize - balloon["border" + m.camel.pos.o]));
makeTip(balloon, outerTip, m, options.tipSize, $balloon.css("border-" + m.pos.o + "-color"));
makeTip(balloon, innerTip, m, options.tipSize - 2 * balloon["border" + m.camel.pos.o], $balloon.css("background-color"));
makeTip(balloon, outerTip, m, options.tipSize, $balloon.css("border-" + m.pos.o + "-color"), options.tipPosition);
makeTip(balloon, innerTip, m, options.tipSize - 2 * balloon["border" + m.camel.pos.o], $balloon.css("background-color"), options.tipPosition);
$balloon.data("outerTip", outerTip.$).data("innerTip", innerTip.$);
} else {
$.each([outerTip.$, innerTip.$], function() { this.remove(); });
Expand All @@ -152,7 +152,7 @@
["setBorder" + m.camel.pos.c1](len)
["setBorder" + m.camel.pos.c2](len)
["set" + m.camel.pos.p1]((m.isTopLeft) ? -tipSize : balloon.inner[m.size.p])
["set" + m.camel.pos.c1](balloon.inner[m.size.c] / 2 - len)
["set" + m.camel.pos.c1](balloon.inner[m.size.c] / tipPosition - len)
.active()
.$.css("border-" + m.pos.f + "-color", color);
}
Expand Down Expand Up @@ -292,7 +292,7 @@
$.balloon = {
defaults: {
contents: null, url: null, ajaxComplete: null, classname: null,
position: "top", offsetX: 0, offsetY: 0, tipSize: 12,
position: "top", offsetX: 0, offsetY: 0, tipSize: 12, tipPosition: 2,
delay: 0, minLifetime: 200, maxLifetime: 0,
showDuration: 100, showAnimation: null,
hideDuration: 80, hideAnimation: function(d, c) { this.fadeOut(d, c); },
Expand Down

0 comments on commit 7b1143b

Please sign in to comment.