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

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2017-10-19 23:48:29 +0300
committerGleb Mazovetskiy <glex.spb@gmail.com>2017-10-19 23:48:29 +0300
commit4322a3c379b89c6c91b9d3bc3f24073567023837 (patch)
tree92a4cff22e07e217e014e0501ee180c202408499 /assets/javascripts/bootstrap/dropdown.js
parent415995c24bc98dfb9efda792424294e82bda244b (diff)
rake update[v4.0.0-beta.2]
Diffstat (limited to 'assets/javascripts/bootstrap/dropdown.js')
-rw-r--r--assets/javascripts/bootstrap/dropdown.js25
1 files changed, 18 insertions, 7 deletions
diff --git a/assets/javascripts/bootstrap/dropdown.js b/assets/javascripts/bootstrap/dropdown.js
index 18af2d3..e83f0fd 100644
--- a/assets/javascripts/bootstrap/dropdown.js
+++ b/assets/javascripts/bootstrap/dropdown.js
@@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta): dropdown.js
+ * Bootstrap (v4.0.0-beta.2): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -24,7 +24,7 @@ var Dropdown = function () {
var NAME = 'dropdown';
- var VERSION = '4.0.0-beta';
+ var VERSION = '4.0.0-beta.2';
var DATA_KEY = 'bs.dropdown';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
@@ -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,4 +439,4 @@ var Dropdown = function () {
};
return Dropdown;
-}(jQuery, Popper);
+}($, Popper);