diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2015-11-17 10:06:24 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2015-11-17 10:06:24 +0300 |
commit | 289d93f77336bc8b78e6328eea69f558c144e5bd (patch) | |
tree | 61021f4e8746fad95f751c66e6bb3cae6def99da /assets/javascripts/bootstrap/tooltip.js | |
parent | c00bd6966ae0e74c7ba16f4e2450a2a7b0289694 (diff) |
rake update[v4-dev]
Diffstat (limited to 'assets/javascripts/bootstrap/tooltip.js')
-rw-r--r-- | assets/javascripts/bootstrap/tooltip.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/assets/javascripts/bootstrap/tooltip.js b/assets/javascripts/bootstrap/tooltip.js index 445ca6e..45c0702 100644 --- a/assets/javascripts/bootstrap/tooltip.js +++ b/assets/javascripts/bootstrap/tooltip.js @@ -1,3 +1,5 @@ +/* global Tether */ + 'use strict'; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); @@ -14,6 +16,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons var Tooltip = (function ($) { /** + * Check for Tether dependency + * Tether - http://github.hubspot.com/tether/ + */ + if (window.Tether === undefined) { + throw new Error('Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)'); + } + + /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ @@ -248,7 +258,8 @@ var Tooltip = (function ($) { classes: TetherClass, classPrefix: CLASS_PREFIX, offset: this.config.offset, - constraints: this.config.constraints + constraints: this.config.constraints, + addTargetClasses: false }); Util.reflow(tip); @@ -370,12 +381,6 @@ var Tooltip = (function ($) { value: function 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); } } @@ -414,11 +419,6 @@ var Tooltip = (function ($) { } } }, { - key: '_removeTetherClasses', - value: function _removeTetherClasses(i, css) { - return ((css.baseVal || css).match(new RegExp('(^|\\s)' + CLASS_PREFIX + '-\\S+', 'g')) || []).join(' '); - } - }, { key: '_fixTitle', value: function _fixTitle() { var titleType = typeof this.element.getAttribute('data-original-title'); |