Browse Source

Only reposition the current menu element

pull/4211/head
Andrei Horodinca 7 years ago
parent
commit
06aaeb007a
2 changed files with 4 additions and 17 deletions
  1. 20
      src/definitions/modules/dropdown.js
  2. 1
      src/definitions/modules/dropdown.less

20
src/definitions/modules/dropdown.js

@ -2391,10 +2391,6 @@ $.fn.dropdown = function(parameters) {
},
leftward: function($menu) {
var $element = $menu || $module;
var parentMenu = $element.parent().closest(selector.menu);
if (parentMenu.hasClass('transition')) {
$element = parentMenu;
}
$element.addClass(className.leftward);
},
value: function(value, text, $selected) {
@ -2750,10 +2746,6 @@ $.fn.dropdown = function(parameters) {
},
leftward: function($menu) {
var $element = $menu || $module;
var parentMenu = $element.parent().closest(selector.menu);
if (parentMenu.hasClass('transition')) {
$element = parentMenu;
}
$element.removeClass(className.leftward);
},
visible: function() {
@ -3127,17 +3119,11 @@ $.fn.dropdown = function(parameters) {
;
$currentMenu.addClass(className.loading);
calculations = {
childrenWidth: 0,
contextWidth: $context.outerWidth(),
menuOffset : $currentMenu.offset().left,
menuWidth : $currentMenu.outerWidth()
menuOffset: $currentMenu.offset().left,
menuWidth: $currentMenu.outerWidth()
};
$currentMenu.find(selector.menu).each(function() {
var child = $(this);
child.show();
calculations.childrenWidth += child[0].offsetWidth;
});
isOutsideScreen = ((calculations.contextWidth < calculations.menuOffset + calculations.menuWidth + calculations.childrenWidth) || (calculations.menuOffset - $menu.offset().left < 0));
isOutsideScreen = (calculations.contextWidth < calculations.menuOffset + calculations.menuWidth) || (calculations.menuOffset - $menu.offset().left < 0);
if(isOutsideScreen) {
module.verbose('Dropdown cannot fit in context rightward', isOutsideScreen);

1
src/definitions/modules/dropdown.less

@ -952,6 +952,7 @@ select.ui.dropdown {
/* Left Flyout Menu */
.ui.dropdown > .left.menu .menu,
.ui.dropdown .menu .left.menu {
display: block !important;
left: auto !important;
right: 100% !important;
border-radius: @leftSubMenuBorderRadius !important;

Loading…
Cancel
Save