From adaabab81bcc7da1c832ecdab79db9d87f04e5b2 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 29 Dec 2014 20:03:27 -0800 Subject: Revert "Allow multiple delegated tooltip selectors on a node" This reverts commit 1b3237629a316af41945e20837cf3a332798b264. This reverts PR #14189 because it caused major regressions. Fixes #15168. We'll try to revisit #14167's feature request in Bootstrap v4. [skip validator] --- js/tooltip.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'js/tooltip.js') diff --git a/js/tooltip.js b/js/tooltip.js index cda147d9c..a3bed9856 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -445,18 +445,12 @@ function Plugin(option) { return this.each(function () { - var $this = $(this) - var data = $this.data('bs.tooltip') - var options = typeof option == 'object' && option - var selector = options && options.selector + var $this = $(this) + var data = $this.data('bs.tooltip') + var options = typeof option == 'object' && option if (!data && option == 'destroy') return - if (selector) { - if (!data) $this.data('bs.tooltip', (data = {})) - if (!data[selector]) data[selector] = new Tooltip(this, options) - } else { - if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) - } + if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (typeof option == 'string') data[option]() }) } -- cgit v1.2.3 From 576230b92ae5a082eb8e058dc2fab7c67c99bd19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatan=20Vasovi=C4=87?= Date: Thu, 1 Jan 2015 01:23:48 +0100 Subject: Happy New Year :santa: --- 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 a3bed9856..a1140d247 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -3,7 +3,7 @@ * http://getbootstrap.com/javascript/#tooltip * Inspired by the original jQuery.tipsy by Jason Frame * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -- cgit v1.2.3 From 0481ce973f2c10753e23d2de21aafb78c582a0e5 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 16 Jan 2015 17:45:58 +0200 Subject: Fix bogus JSCS warning. --- js/tooltip.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/tooltip.js') diff --git a/js/tooltip.js b/js/tooltip.js index a1140d247..f9adb81ef 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -346,10 +346,10 @@ } Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { - return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : - placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : + return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : - /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } + /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } } -- cgit v1.2.3