Skip to content

Commit

Permalink
Detach content before removing the tooltip, to preserve potential han…
Browse files Browse the repository at this point in the history
…dlers from jQuery's remove()'s deletion, for later use
  • Loading branch information
louisameline committed Mar 17, 2014
1 parent 333106f commit 14bdbe0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tooltipster",
"version": "3.1.0",
"version": "3.1.1",
"main": ["js/jquery.tooltipster.min.js", "css/tooltipster.css"],
"dependencies": {
"jquery": ">=1.7"
Expand Down
7 changes: 6 additions & 1 deletion js/jquery.tooltipster.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Tooltipster 3.0.5 | 2014-01-15
Tooltipster 3.1.1 | 2014-01-15
A rockin' custom tooltip jQuery plugin
Developed by Caleb Jacob under the MIT license http://opensource.org/licenses/MIT
Expand Down Expand Up @@ -519,6 +519,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

self.status = 'hidden';

// detach our content object first, so the next jQuery's remove() call does not unbind its event handlers
if (typeof self.content == 'object' && self.content !== null) {
self.content.detach();
}

self.$tooltip.remove();
self.$tooltip = null;

Expand Down
2 changes: 1 addition & 1 deletion js/jquery.tooltipster.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tooltipster.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"keywords": [
"tooltip"
],
"version": "3.1.0",
"version": "3.1.1",
"author": {
"name": "Caleb Jacob",
"url": "http://calebjacob.com/"
Expand Down

0 comments on commit 14bdbe0

Please sign in to comment.