1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 07:37:27 +02:00
This commit is contained in:
Mark Otto
2017-10-15 15:51:44 -07:00
parent 3ccb7ef16a
commit 7ce2b03b1a
39 changed files with 245 additions and 186 deletions

21
js/dist/dropdown.js vendored
View File

@@ -77,7 +77,7 @@ var Dropdown = function () {
flip: true
};
var DefaultType = {
offset: '(number|string)',
offset: '(number|string|function)',
flip: 'boolean'
/**
* ------------------------------------------------------------------------
@@ -225,12 +225,23 @@ var Dropdown = function () {
};
_proto._getPopperConfig = function _getPopperConfig() {
var _this2 = this;
var offsetConf = {};
if (typeof this._config.offset === 'function') {
offsetConf.fn = function (data) {
data.offsets = $.extend({}, data.offsets, _this2._config.offset(data.offsets) || {});
return data;
};
} else {
offsetConf.offset = this._config.offset;
}
var popperConfig = {
placement: this._getPlacement(),
modifiers: {
offset: {
offset: this._config.offset
},
offset: offsetConf,
flip: {
enabled: this._config.flip
}
@@ -428,5 +439,5 @@ var Dropdown = function () {
};
return Dropdown;
}(jQuery, Popper);
}($, Popper);
//# sourceMappingURL=dropdown.js.map