Skip to content

Commit

Permalink
Fixed the functionBefore and functionAfter which were called with par…
Browse files Browse the repository at this point in the history
…ameter instead of . Also, they are now called in the context of
  • Loading branch information
louisameline committed Feb 24, 2014
1 parent a273e26 commit b35de6c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/jquery.tooltipster.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
self.setContent(t);
}

var c = self.options.functionInit(self.$el, self.content);
var c = self.options.functionInit.call(self.$el, self.$el, self.content);
if(typeof c !== 'undefined') self.setContent(c);

self.$el
Expand Down Expand Up @@ -243,7 +243,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}

// call our constructor custom function before continuing
self.options.functionBefore(self.$elProxy, function() {
self.options.functionBefore.call(self.$el, self.$el, function() {

var finish = function() {
self.status = 'shown';
Expand Down Expand Up @@ -322,7 +322,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
self.positionTooltip();

// call our custom callback since the content of the tooltip is now part of the DOM
self.options.functionReady(self.$el, self.$tooltip);
self.options.functionReady.call(self.$el, self.$el, self.$tooltip);

// animate in the tooltip
if (supportsTransitions()) {
Expand Down Expand Up @@ -534,7 +534,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
self.$elProxy.off('.'+ self.namespace + '-autoClose');

// call our constructor custom callback function
self.options.functionAfter(self.$elProxy);
self.options.functionAfter.call(self.$el, self.$el);

// call our method custom callbacks functions
finishCallbacks();
Expand Down

0 comments on commit b35de6c

Please sign in to comment.