From f350d1ba3df6f477203d721a213d4f9a753aa17d Mon Sep 17 00:00:00 2001 From: Jochen Berger Date: Mon, 23 Sep 2013 15:14:37 +0200 Subject: don't create new Tooltip/Popover objects just to destroy them immediately --- js/tooltip.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/tooltip.js') diff --git a/js/tooltip.js b/js/tooltip.js index 89802287a..65006e24f 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -365,6 +365,7 @@ return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') + if (!data && option === 'destroy') return var options = typeof option == 'object' && option if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) -- cgit v1.2.3 From 926b940e8674a7ebeef085af1860a78fcaaf813d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Fri, 15 Nov 2013 23:33:23 +0000 Subject: Clear timeout on destroy. Clears the internal timeout on destroy so that hanging timers are not fired. --- js/tooltip.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/tooltip.js') diff --git a/js/tooltip.js b/js/tooltip.js index 9e6177554..4ad6f7b31 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -352,6 +352,7 @@ } Tooltip.prototype.destroy = function () { + clearTimeout(this.timeout); this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) } -- cgit v1.2.3 From 39091b0748d9825ec415a57a984a8b96a9fe2abe Mon Sep 17 00:00:00 2001 From: fat Date: Thu, 26 Dec 2013 18:18:53 -0800 Subject: nope --- js/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tooltip.js') diff --git a/js/tooltip.js b/js/tooltip.js index 99dbc68fc..b465b9a8e 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -362,7 +362,7 @@ } Tooltip.prototype.destroy = function () { - clearTimeout(this.timeout); + clearTimeout(this.timeout) this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) } -- cgit v1.2.3 From 3c73904e1728df9bfb6e6b7dfe3b3b732d066784 Mon Sep 17 00:00:00 2001 From: fat Date: Thu, 26 Dec 2013 18:27:43 -0800 Subject: update tool/pop destroy placement --- js/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tooltip.js') diff --git a/js/tooltip.js b/js/tooltip.js index 0d3086e9a..d491fea0e 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -376,9 +376,9 @@ return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') - if (!data && option === 'destroy') return var options = typeof option == 'object' && option + if (!data && option == 'destroy') return if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (typeof option == 'string') data[option]() }) -- cgit v1.2.3