From 926fb111581e9854d4c50b5f5e0f6876d7cbf176 Mon Sep 17 00:00:00 2001 From: lbryant Date: Thu, 20 Aug 2015 01:03:29 -0400 Subject: use Tether addTargetClasses: false option instead of manually removing them --- js/src/tooltip.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'js/src/tooltip.js') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index a65caf26e..0af63c981 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -270,12 +270,13 @@ const Tooltip = (($) => { this._tether = new Tether({ attachment, - element : tip, - target : this.element, - classes : TetherClass, - classPrefix : CLASS_PREFIX, - offset : this.config.offset, - constraints : this.config.constraints + element : tip, + target : this.element, + classes : TetherClass, + classPrefix : CLASS_PREFIX, + offset : this.config.offset, + constraints : this.config.constraints, + addTargetClasses: false }) Util.reflow(tip) @@ -384,12 +385,6 @@ const Tooltip = (($) => { cleanupTether() { if (this._tether) { this._tether.destroy() - - // clean up after tether's junk classes - // remove after they fix issue - // (https://github.com/HubSpot/tether/issues/36) - $(this.element).removeClass(this._removeTetherClasses) - $(this.tip).removeClass(this._removeTetherClasses) } } -- cgit v1.2.3 From 8b15b5a2622043a57138ff38cd99ee7c9a418bf0 Mon Sep 17 00:00:00 2001 From: lbryant Date: Thu, 20 Aug 2015 01:22:16 -0400 Subject: _removeTetherClasses is no longer referenced --- js/src/tooltip.js | 6 ------ 1 file changed, 6 deletions(-) (limited to 'js/src/tooltip.js') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 0af63c981..f54a1dca9 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -438,12 +438,6 @@ const Tooltip = (($) => { } } - _removeTetherClasses(i, css) { - return ((css.baseVal || css).match( - new RegExp(`(^|\\s)${CLASS_PREFIX}-\\S+`, 'g')) || [] - ).join(' ') - } - _fixTitle() { let titleType = typeof this.element.getAttribute('data-original-title') if (this.element.getAttribute('title') || -- cgit v1.2.3 From 21a65f181eebc3f2c0cd43fb3383ee3de673745b Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 16 Sep 2015 10:35:29 +0200 Subject: Add throw error for undefined method on plugins --- js/src/tooltip.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/src/tooltip.js') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 151cd6f51..b80bd8e8c 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -622,6 +622,9 @@ const Tooltip = (($) => { } if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error(`No method named "${config}"`) + } data[config]() } }) -- cgit v1.2.3 From 2d87ec9a64b521807786f476dfe1b7a555b43e4b Mon Sep 17 00:00:00 2001 From: Jon Tewksbury Date: Tue, 3 Nov 2015 15:04:26 -0800 Subject: Add eslint no-undef rule and resolve errors --- js/src/tooltip.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/src/tooltip.js') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index b80bd8e8c..749e42379 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -1,3 +1,5 @@ +/* global Tether */ + import Util from './util' -- cgit v1.2.3 From d600831a153c9930c3fe4e618b187951abc7b43b Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 14 Nov 2015 20:35:10 -0800 Subject: add explicit error for lack of tether in tooltips - fixes #17273 --- js/src/tooltip.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/src/tooltip.js') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 30c2f7165..173ee592e 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -12,6 +12,14 @@ import Util from './util' const Tooltip = (($) => { + /** + * Check for Tether dependency + * Tether - http://github.hubspot.com/tether/ + */ + if (!window.Tether) { + throw new Error('Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)') + } + /** * ------------------------------------------------------------------------ -- cgit v1.2.3 From ece98f980cc9dedbab099bd8d4fc1540a218bb9d Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 14 Nov 2015 20:43:45 -0800 Subject: add undefined for now --- js/src/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/tooltip.js') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 173ee592e..6bd17353d 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -16,7 +16,7 @@ const Tooltip = (($) => { * Check for Tether dependency * Tether - http://github.hubspot.com/tether/ */ - if (!window.Tether) { + if (window.Tether === undefined) { throw new Error('Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)') } -- cgit v1.2.3 From 75c39f9138ea95e8d472812117b13f1ed7978157 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sat, 5 Dec 2015 02:19:21 -0800 Subject: Fix version numbers is JS files; fixes #18435 [skip sauce] [skip validator] --- js/src/tooltip.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/src/tooltip.js') diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 6bd17353d..b0eec1abc 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -5,7 +5,7 @@ import Util from './util' /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0): tooltip.js + * Bootstrap (v4.0.0-alpha): tooltip.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -28,7 +28,7 @@ const Tooltip = (($) => { */ const NAME = 'tooltip' - const VERSION = '4.0.0' + const VERSION = '4.0.0-alpha' const DATA_KEY = 'bs.tooltip' const EVENT_KEY = `.${DATA_KEY}` const JQUERY_NO_CONFLICT = $.fn[NAME] -- cgit v1.2.3