diff options
author | Mark Otto <otto@github.com> | 2019-02-11 22:15:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-11 22:15:34 +0300 |
commit | 1ded0d6a4eefb7daca62c44e4e735aec200f0b6f (patch) | |
tree | e0036e5068cfb8e2c17971c4e892bd6b502dda9a /js/dist/tooltip.js | |
parent | 3aa0770b711f69c4dcf5858b8913794e81b32d80 (diff) |
Release v4.3.0 (#28228)v4.3.0
* Prep for v4.3.0
* More updates for v4.3.0.
* rerun to build docs source map
Diffstat (limited to 'js/dist/tooltip.js')
-rw-r--r-- | js/dist/tooltip.js | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index ea50ce21b0..7b6807e6f7 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -1,5 +1,5 @@ /*! - * Bootstrap tooltip.js v4.2.1 (https://getbootstrap.com/) + * Bootstrap tooltip.js v4.3.0 (https://getbootstrap.com/) * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -70,7 +70,7 @@ */ var NAME = 'tooltip'; - var VERSION = '4.2.1'; + var VERSION = '4.3.0'; var DATA_KEY = 'bs.tooltip'; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; @@ -85,7 +85,7 @@ html: 'boolean', selector: '(string|boolean)', placement: '(string|function)', - offset: '(number|string)', + offset: '(number|string|function)', container: '(string|element|boolean)', fallbackPlacement: '(string|array)', boundary: '(string|element)' @@ -294,9 +294,7 @@ this._popper = new Popper(this.element, tip, { placement: attachment, modifiers: { - offset: { - offset: this.config.offset - }, + offset: this._getOffset(), flip: { behavior: this.config.fallbackPlacement }, @@ -455,6 +453,23 @@ } // Private ; + _proto._getOffset = function _getOffset() { + var _this3 = this; + + var offset = {}; + + if (typeof this.config.offset === 'function') { + offset.fn = function (data) { + data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); + return data; + }; + } else { + offset.offset = this.config.offset; + } + + return offset; + }; + _proto._getContainer = function _getContainer() { if (this.config.container === false) { return document.body; @@ -472,27 +487,27 @@ }; _proto._setListeners = function _setListeners() { - var _this3 = this; + var _this4 = this; var triggers = this.config.trigger.split(' '); triggers.forEach(function (trigger) { if (trigger === 'click') { - $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) { - return _this3.toggle(event); + $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) { + return _this4.toggle(event); }); } else if (trigger !== Trigger.MANUAL) { - var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN; - var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT; - $(_this3.element).on(eventIn, _this3.config.selector, function (event) { - return _this3._enter(event); - }).on(eventOut, _this3.config.selector, function (event) { - return _this3._leave(event); + var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; + var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; + $(_this4.element).on(eventIn, _this4.config.selector, function (event) { + return _this4._enter(event); + }).on(eventOut, _this4.config.selector, function (event) { + return _this4._leave(event); }); } }); $(this.element).closest('.modal').on('hide.bs.modal', function () { - if (_this3.element) { - _this3.hide(); + if (_this4.element) { + _this4.hide(); } }); |