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/popover.js | 1 + js/tooltip.js | 1 + 2 files changed, 2 insertions(+) (limited to 'js') diff --git a/js/popover.js b/js/popover.js index ecd37ac23..e313242e8 100644 --- a/js/popover.js +++ b/js/popover.js @@ -96,6 +96,7 @@ return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') + if (!data && option === 'destroy') return var options = typeof option == 'object' && option if (!data) $this.data('bs.popover', (data = new Popover(this, options))) 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 1c1850f63eac532b6a1fb89e6b5ea28b2c8168ec Mon Sep 17 00:00:00 2001 From: Travesty3 Date: Wed, 25 Sep 2013 08:59:01 -0400 Subject: Add 'collapse' class back after expanding --- js/collapse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/collapse.js b/js/collapse.js index 92cc0bc76..85347d5f5 100644 --- a/js/collapse.js +++ b/js/collapse.js @@ -69,7 +69,7 @@ var complete = function () { this.$element .removeClass('collapsing') - .addClass('in') + .addClass('collapse in') [dimension]('auto') this.transitioning = 0 this.$element.trigger('shown.bs.collapse') -- cgit v1.2.3 From 12a3bb31f82b7fee96dbd5d91f4a5bef90c7acd6 Mon Sep 17 00:00:00 2001 From: Alexander Prinzhorn Date: Fri, 27 Sep 2013 11:32:06 +0200 Subject: Only preventDefault on click on [data-toggle="modal"] when the element is a link In it's current state Bootstrap always prevents the default action for a click event on `[data-toggle="modal"]` elements (see https://github.com/twbs/bootstrap/blob/master/js/modal.js#L233). Instead this should only happen when the element is a link. --- js/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/modal.js b/js/modal.js index 65eba481e..349431d99 100644 --- a/js/modal.js +++ b/js/modal.js @@ -230,7 +230,7 @@ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) - e.preventDefault() + if ($this.is('a')) e.preventDefault() $target .modal(option, this) -- 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') 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 1e05029d1a9b8057e59b7046d08b09d75548c310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatan=20Vasovi=C4=87?= Date: Wed, 25 Dec 2013 20:22:52 +0100 Subject: Fix wrong indent in .jscs.json --- js/.jscs.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'js') diff --git a/js/.jscs.json b/js/.jscs.json index c4cac13de..096da217d 100644 --- a/js/.jscs.json +++ b/js/.jscs.json @@ -1,15 +1,15 @@ { - "disallowKeywords": ["with"], - "requireLeftStickedOperators": [","], - "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], - "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireLineFeedAtFileEnd": true, - "requireRightStickedOperators": ["!"], - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "validateLineBreaks": "LF" + "disallowKeywords": ["with"], + "requireLeftStickedOperators": [","], + "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireLineFeedAtFileEnd": true, + "requireRightStickedOperators": ["!"], + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "validateLineBreaks": "LF" } -- cgit v1.2.3 From 34fb5767cbe94bd379e792e8236a0f8f41d46545 Mon Sep 17 00:00:00 2001 From: fat Date: Thu, 26 Dec 2013 17:53:31 -0800 Subject: fixes #10798 --- js/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/modal.js b/js/modal.js index 4ef39e0a5..e74b59137 100644 --- a/js/modal.js +++ b/js/modal.js @@ -216,7 +216,7 @@ var $this = $(this) var href = $this.attr('href') var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 - var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) + var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) if ($this.is('a')) e.preventDefault() -- 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') 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/popover.js | 2 +- js/tooltip.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/popover.js b/js/popover.js index 84713bcc6..1e8104c4f 100644 --- a/js/popover.js +++ b/js/popover.js @@ -85,9 +85,9 @@ return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') - if (!data && option === 'destroy') return var options = typeof option == 'object' && option + if (!data && option == 'destroy') return if (!data) $this.data('bs.popover', (data = new Popover(this, options))) if (typeof option == 'string') data[option]() }) 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