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-30 02:19:14 +0300
committerMark Otto <markdotto@gmail.com>2017-10-30 02:19:14 +0300
commitc5af0a7d6aa6c2021c7e172e0baee030bdffcc71 (patch)
tree4d107dc130493aad6891aede69632f5a023a729b /js/dist/dropdown.js
parentb5cd9b91b2f93418bcaa6cb081cc842a6e6ef58c (diff)
dist
Diffstat (limited to 'js/dist/dropdown.js')
-rw-r--r--js/dist/dropdown.js30
1 files changed, 20 insertions, 10 deletions
diff --git a/js/dist/dropdown.js b/js/dist/dropdown.js
index acc919ff90..cf8674871f 100644
--- a/js/dist/dropdown.js
+++ b/js/dist/dropdown.js
@@ -10,19 +10,10 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
*/
var Dropdown = function ($) {
/**
- * Check for Popper dependency
- * Popper - https://popper.js.org
- */
- if (typeof Popper === 'undefined') {
- throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)');
- }
- /**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
-
-
var NAME = 'dropdown';
var VERSION = '4.0.0-beta.2';
var DATA_KEY = 'bs.dropdown';
@@ -56,6 +47,8 @@ var Dropdown = function ($) {
DISABLED: 'disabled',
SHOW: 'show',
DROPUP: 'dropup',
+ DROPRIGHT: 'dropright',
+ DROPLEFT: 'dropleft',
MENURIGHT: 'dropdown-menu-right',
MENULEFT: 'dropdown-menu-left'
};
@@ -70,7 +63,11 @@ var Dropdown = function ($) {
TOP: 'top-start',
TOPEND: 'top-end',
BOTTOM: 'bottom-start',
- BOTTOMEND: 'bottom-end'
+ BOTTOMEND: 'bottom-end',
+ RIGHT: 'right-start',
+ RIGHTEND: 'right-end',
+ LEFT: 'left-start',
+ LEFTEND: 'left-end'
};
var Default = {
offset: 0,
@@ -128,6 +125,15 @@ var Dropdown = function ($) {
if (showEvent.isDefaultPrevented()) {
return;
}
+ /**
+ * Check for Popper dependency
+ * Popper - https://popper.js.org
+ */
+
+
+ if (typeof Popper === 'undefined') {
+ throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)');
+ }
var element = this._element; // for dropup with alignment we use the parent as popper container
@@ -213,6 +219,10 @@ var Dropdown = function ($) {
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.TOPEND;
}
+ } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
+ placement = AttachmentMap.RIGHT;
+ } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
+ placement = AttachmentMap.LEFT;
} else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.BOTTOMEND;
}