diff options
| author | Johann-S <[email protected]> | 2017-04-21 10:49:04 +0200 |
|---|---|---|
| committer | Johann-S <[email protected]> | 2017-05-14 11:41:19 +0200 |
| commit | 4f882a840c9f2b62f543c32d56b3e904582ced90 (patch) | |
| tree | df5deaa483317cde922456c8d82f7712997c6dcc /js/src | |
| parent | 65d0d9831ad1dbf70c0ac702bbf1fc5b3e965805 (diff) | |
| download | bootstrap-4f882a840c9f2b62f543c32d56b3e904582ced90.tar.xz bootstrap-4f882a840c9f2b62f543c32d56b3e904582ced90.zip | |
Allow to disable flip behaviour on Dropdown + documentation
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/dropdown.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 0c082edd6..71247728a 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -71,12 +71,14 @@ const Dropdown = (($) => { const Default = { placement : AttachmentMap.BOTTOM, - offset : 0 + offset : 0, + flip : true } const DefaultType = { placement : 'string', - offset : '(number|string)' + offset : '(number|string)', + flip : 'boolean' } @@ -153,6 +155,9 @@ const Dropdown = (($) => { modifiers : { offset : { offset : context._config.offset + }, + flip : { + enabled : context._config.flip } } }) @@ -201,6 +206,11 @@ const Dropdown = (($) => { } _getConfig(config) { + const elementData = $(this._element).data() + if (elementData.placement !== undefined) { + elementData.placement = AttachmentMap[elementData.placement.toUpperCase()] + } + config = $.extend( {}, this.constructor.Default, |
