Browse files

Ensure that 1st arg as function is called for each tooltip

  • Loading branch information...
1 parent 2caf78c commit 875c312496eefe1531899687fe663f9dc89b5f9e @kswedberg committed Jul 20, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 jquery.cluetip.js
View
9 jquery.cluetip.js
@@ -204,7 +204,8 @@
this.each(function(index) {
- var link = this,
+ var jsContent,
+ link = this,
$link = $(this),
// support metadata plugin (v1.0 and 2.0)
opts = $.extend(true, {}, options, $.metadata ? $link.metadata() : $.meta ? $link.data() : $link.data('cluetip') || {}),
@@ -352,9 +353,11 @@
***************************************/
if (js) {
if (typeof js == 'function') {
- js = js.call(link);
+ jsContent = js.call(link);
+ } else {
+ jsContent = js;
}
- $cluetipInner.html(js);
+ $cluetipInner.html(jsContent);
cluetipShow(pY);
}
/***************************************

1 comment on commit 875c312

@archon810

Fixes #132.

Please sign in to comment.