Skip to content

Commit

Permalink
can enable/disable tipsy per element. #closes 10
Browse files Browse the repository at this point in the history
  • Loading branch information
jaz303 committed Apr 27, 2010
1 parent 3d75abb commit f27fc38
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/javascripts/jquery.tipsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
function Tipsy(element, options) {
this.$element = $(element);
this.options = options;
this.enabled = true;
}

Tipsy.prototype = {
show: function() {
var title = this.getTitle();
if (title) {
if (title && this.enabled) {
var $tip = this.tip();

$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
Expand Down Expand Up @@ -84,7 +85,11 @@
});
}
return this.$tip;
}
},

enable: function() { this.enabled = true; },
disable: function() { this.enabled = false; },
toggleEnabled: function() { this.enabled = !this.enabled; }
};

$.fn.tipsy = function(options) {
Expand Down

0 comments on commit f27fc38

Please sign in to comment.