Skip to content

Commit

Permalink
Better support for target
Browse files Browse the repository at this point in the history
  • Loading branch information
Youpinadi committed Nov 4, 2013
1 parent 3c356f9 commit cd308c2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/javascripts/jquery.tipsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,26 +97,25 @@

getTitle: function() {
var title, $e = this.$element, o = this.options;
this.fixTitle();
var title, o = this.options;

if (typeof o.target == 'string')
if (o.target)
{
o.html = true;
o.interactive = true;
o.delayOut = 100;
title = $(o.target).html();
title = $j(o.target).hide().html();
}
else
{
this.fixTitle();
var title, o = this.options;
if (typeof o.title == 'string') {
title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
} else if (typeof o.title == 'function') {
title = o.title.call($e[0]);
}
title = ('' + title).replace(/(^\s*|\s*$)/, "");
}
title = ('' + title).replace(/(^\s*|\s*$)/, "");

return title || o.fallback;
},

Expand Down Expand Up @@ -224,7 +223,6 @@
offset: 0,
opacity: 1,
title: 'title',
target: null,
trigger: 'hover',
interactive: false
};
Expand Down

0 comments on commit cd308c2

Please sign in to comment.