mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 12:59:05 +02:00
Release v4.3.0 (#28228)
* Prep for v4.3.0 * More updates for v4.3.0. * rerun to build docs source map
This commit is contained in:
49
js/dist/tooltip.js
vendored
49
js/dist/tooltip.js
vendored
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user