Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <markdotto@gmail.com>2017-10-16 01:51:44 +0300
committerMark Otto <markdotto@gmail.com>2017-10-16 01:51:44 +0300
commit7ce2b03b1a6a773a2f9f2a0f36832d8cb9b30b79 (patch)
tree6ad4504f7167b309dc0bb1558270fc615abea1eb /js/dist/dropdown.js
parent3ccb7ef16ad2fa858c767128a5414a0b1bd7fa30 (diff)
dist
Diffstat (limited to 'js/dist/dropdown.js')
-rw-r--r--js/dist/dropdown.js21
1 files changed, 16 insertions, 5 deletions
diff --git a/js/dist/dropdown.js b/js/dist/dropdown.js
index 0529174795..e921f5b49f 100644
--- a/js/dist/dropdown.js
+++ b/js/dist/dropdown.js
@@ -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 \ No newline at end of file