Commit 4282d892 authored by Mark Otto's avatar Mark Otto
Browse files

build

parent c8c51186
6 merge requests!28721Hot test,!27561Adds font-weight-medium to font weight classes,!25326Adjust examples,!23995Add back cursor: pointer for .btn-link,!23178Spinner,!17021v4
Showing with 75 additions and 17 deletions
+75 -17
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -1428,7 +1428,10 @@ var Dropdown = function ($) { ...@@ -1428,7 +1428,10 @@ var Dropdown = function ($) {
var ClassName = { var ClassName = {
DISABLED: 'disabled', DISABLED: 'disabled',
SHOW: 'show' SHOW: 'show',
DROPUP: 'dropup',
MENURIGHT: 'dropdown-menu-right',
MENULEFT: 'dropdown-menu-left'
}; };
var Selector = { var Selector = {
...@@ -1441,7 +1444,9 @@ var Dropdown = function ($) { ...@@ -1441,7 +1444,9 @@ var Dropdown = function ($) {
var AttachmentMap = { var AttachmentMap = {
TOP: 'top-start', TOP: 'top-start',
BOTTOM: 'bottom-start' TOPEND: 'top-end',
BOTTOM: 'bottom-start',
BOTTOMEND: 'bottom-end'
}; };
var Default = { var Default = {
...@@ -1503,10 +1508,15 @@ var Dropdown = function ($) { ...@@ -1503,10 +1508,15 @@ var Dropdown = function ($) {
return; return;
} }
// Handle dropup var element = this._element;
var dropdownPlacement = $(this._element).parent().hasClass('dropup') ? AttachmentMap.TOP : this._config.placement; // for dropup with alignment we use the parent as popper container
this._popper = new Popper(this._element, this._menu, { if ($(parent).hasClass(ClassName.DROPUP)) {
placement: dropdownPlacement, if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) {
element = parent;
}
}
this._popper = new Popper(element, this._menu, {
placement: this._getPlacement(),
modifiers: { modifiers: {
offset: { offset: {
offset: this._config.offset offset: this._config.offset
...@@ -1582,6 +1592,24 @@ var Dropdown = function ($) { ...@@ -1582,6 +1592,24 @@ var Dropdown = function ($) {
return this._menu; return this._menu;
}; };
Dropdown.prototype._getPlacement = function _getPlacement() {
var $parentDropdown = $(this._element).parent();
var placement = this._config.placement;
// Handle dropup
if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) {
placement = AttachmentMap.TOP;
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.TOPEND;
}
} else {
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.BOTTOMEND;
}
}
return placement;
};
// static // static
Dropdown._jQueryInterface = function _jQueryInterface(config) { Dropdown._jQueryInterface = function _jQueryInterface(config) {
...@@ -2944,6 +2972,7 @@ var Tooltip = function ($) { ...@@ -2944,6 +2972,7 @@ var Tooltip = function ($) {
}; };
var AttachmentMap = { var AttachmentMap = {
AUTO: 'auto',
TOP: 'top', TOP: 'top',
RIGHT: 'right', RIGHT: 'right',
BOTTOM: 'bottom', BOTTOM: 'bottom',
...@@ -2952,7 +2981,7 @@ var Tooltip = function ($) { ...@@ -2952,7 +2981,7 @@ var Tooltip = function ($) {
var Default = { var Default = {
animation: true, animation: true,
template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', template: '<div class="tooltip" role="tooltip">' + '<div class="arrow" x-arrow></div>' + '<div class="tooltip-inner"></div></div>',
trigger: 'hover focus', trigger: 'hover focus',
title: '', title: '',
delay: 0, delay: 0,
...@@ -3592,7 +3621,7 @@ var Popover = function ($) { ...@@ -3592,7 +3621,7 @@ var Popover = function ($) {
placement: 'right', placement: 'right',
trigger: 'click', trigger: 'click',
content: '', content: '',
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>' template: '<div class="popover" role="tooltip">' + '<div class="arrow" x-arrow></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
}); });
var DefaultType = $.extend({}, Tooltip.DefaultType, { var DefaultType = $.extend({}, Tooltip.DefaultType, {
......
This diff is collapsed.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -54,7 +54,10 @@ var Dropdown = function ($) { ...@@ -54,7 +54,10 @@ var Dropdown = function ($) {
var ClassName = { var ClassName = {
DISABLED: 'disabled', DISABLED: 'disabled',
SHOW: 'show' SHOW: 'show',
DROPUP: 'dropup',
MENURIGHT: 'dropdown-menu-right',
MENULEFT: 'dropdown-menu-left'
}; };
var Selector = { var Selector = {
...@@ -67,7 +70,9 @@ var Dropdown = function ($) { ...@@ -67,7 +70,9 @@ var Dropdown = function ($) {
var AttachmentMap = { var AttachmentMap = {
TOP: 'top-start', TOP: 'top-start',
BOTTOM: 'bottom-start' TOPEND: 'top-end',
BOTTOM: 'bottom-start',
BOTTOMEND: 'bottom-end'
}; };
var Default = { var Default = {
...@@ -129,10 +134,15 @@ var Dropdown = function ($) { ...@@ -129,10 +134,15 @@ var Dropdown = function ($) {
return; return;
} }
// Handle dropup var element = this._element;
var dropdownPlacement = $(this._element).parent().hasClass('dropup') ? AttachmentMap.TOP : this._config.placement; // for dropup with alignment we use the parent as popper container
this._popper = new Popper(this._element, this._menu, { if ($(parent).hasClass(ClassName.DROPUP)) {
placement: dropdownPlacement, if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) {
element = parent;
}
}
this._popper = new Popper(element, this._menu, {
placement: this._getPlacement(),
modifiers: { modifiers: {
offset: { offset: {
offset: this._config.offset offset: this._config.offset
...@@ -208,6 +218,24 @@ var Dropdown = function ($) { ...@@ -208,6 +218,24 @@ var Dropdown = function ($) {
return this._menu; return this._menu;
}; };
Dropdown.prototype._getPlacement = function _getPlacement() {
var $parentDropdown = $(this._element).parent();
var placement = this._config.placement;
// Handle dropup
if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) {
placement = AttachmentMap.TOP;
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.TOPEND;
}
} else {
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.BOTTOMEND;
}
}
return placement;
};
// static // static
Dropdown._jQueryInterface = function _jQueryInterface(config) { Dropdown._jQueryInterface = function _jQueryInterface(config) {
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -35,7 +35,7 @@ var Popover = function ($) { ...@@ -35,7 +35,7 @@ var Popover = function ($) {
placement: 'right', placement: 'right',
trigger: 'click', trigger: 'click',
content: '', content: '',
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>' template: '<div class="popover" role="tooltip">' + '<div class="arrow" x-arrow></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
}); });
var DefaultType = $.extend({}, Tooltip.DefaultType, { var DefaultType = $.extend({}, Tooltip.DefaultType, {
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -51,6 +51,7 @@ var Tooltip = function ($) { ...@@ -51,6 +51,7 @@ var Tooltip = function ($) {
}; };
var AttachmentMap = { var AttachmentMap = {
AUTO: 'auto',
TOP: 'top', TOP: 'top',
RIGHT: 'right', RIGHT: 'right',
BOTTOM: 'bottom', BOTTOM: 'bottom',
...@@ -59,7 +60,7 @@ var Tooltip = function ($) { ...@@ -59,7 +60,7 @@ var Tooltip = function ($) {
var Default = { var Default = {
animation: true, animation: true,
template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', template: '<div class="tooltip" role="tooltip">' + '<div class="arrow" x-arrow></div>' + '<div class="tooltip-inner"></div></div>',
trigger: 'hover focus', trigger: 'hover focus',
title: '', title: '',
delay: 0, delay: 0,
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment