Browse Source

Fixes height on scrolling menu, adds dividers

pull/2053/head
jlukic 9 years ago
parent
commit
63164074e2
3 changed files with 13 additions and 3 deletions
  1. 2
      src/definitions/modules/dropdown.js
  2. 6
      src/definitions/modules/dropdown.less
  3. 8
      src/themes/default/modules/dropdown.variables

2
src/definitions/modules/dropdown.js

@ -973,7 +973,7 @@ $.fn.dropdown = function(parameters) {
? callback ? callback
: function(){} : function(){}
; ;
if($target.is($module) || $target.is($icon) || $target.is($text)) {
if($target.closest($menu).length == 0) {
module.verbose('Triggering event', callback); module.verbose('Triggering event', callback);
callback(); callback();
return true; return true;

6
src/definitions/modules/dropdown.less

@ -928,6 +928,12 @@ select.ui.dropdown {
border: none; border: none;
border-top: 1px solid @menuBorderColor; border-top: 1px solid @menuBorderColor;
} }
.ui.dropdown .scrolling.menu .item {
border-top: @scrollingMenuItemBorder;
}
.ui.dropdown .scrolling.menu .item:first-child {
border-top: none;
}
.ui.dropdown > .animating.menu .scrolling.menu, .ui.dropdown > .animating.menu .scrolling.menu,
.ui.dropdown > .visible.menu .scrolling.menu { .ui.dropdown > .visible.menu .scrolling.menu {
display: block; display: block;

8
src/themes/default/modules/dropdown.variables

@ -115,13 +115,14 @@
@selectionMinWidth: 200px; @selectionMinWidth: 200px;
@selectionBackground: @white; @selectionBackground: @white;
@selectionDisplay: inline-block; @selectionDisplay: inline-block;
@selectionItemDivider: 1px solid rgba(0, 0, 0, 0.05);
@selectionVerticalPadding: 0.78571em; @selectionVerticalPadding: 0.78571em;
@selectionHorizontalPadding: 1.1em; @selectionHorizontalPadding: 1.1em;
@selectionIconDistance: 2em; @selectionIconDistance: 2em;
@selectionPadding: @selectionVerticalPadding @selectionIconDistance @selectionVerticalPadding @selectionHorizontalPadding; @selectionPadding: @selectionVerticalPadding @selectionIconDistance @selectionVerticalPadding @selectionHorizontalPadding;
@selectionZIndex: 10; @selectionZIndex: 10;
@selectionItemDivider: 1px solid rgba(0, 0, 0, 0.05);
/* <select> */ /* <select> */
@selectBorder: 1px solid @borderColor; @selectBorder: 1px solid @borderColor;
@selectPadding: 0.5em; @selectPadding: 0.5em;
@ -277,12 +278,15 @@
/* Scrolling */ /* Scrolling */
@scrollingMinWidth: 250px; @scrollingMinWidth: 250px;
@scrollingMenuItemBorder: @selectionItemDivider;
@scrollingMobileMaxItems: 4; @scrollingMobileMaxItems: 4;
@scrollingTabletMaxItems: 6; @scrollingTabletMaxItems: 6;
@scrollingComputerMaxItems: 8; @scrollingComputerMaxItems: 8;
@scrollingWidescreenMaxItems: 12; @scrollingWidescreenMaxItems: 12;
@scrollingItemHeight: (@itemVerticalPadding * 2) + @itemLineHeight;
@scrollingBorderEMWidth: 0.0785em; /* 1px / em size */
@scrollingItemHeight: (@itemVerticalPadding * 2) + @itemLineHeight + @scrollingBorderEMWidth;
@scrollingMobileMaxMenuHeight: (@scrollingItemHeight * @scrollingMobileMaxItems); @scrollingMobileMaxMenuHeight: (@scrollingItemHeight * @scrollingMobileMaxItems);
@scrollingTabletMaxMenuHeight: (@scrollingItemHeight * @scrollingTabletMaxItems); @scrollingTabletMaxMenuHeight: (@scrollingItemHeight * @scrollingTabletMaxItems);
@scrollingComputerMaxMenuHeight: (@scrollingItemHeight * @scrollingComputerMaxItems); @scrollingComputerMaxMenuHeight: (@scrollingItemHeight * @scrollingComputerMaxItems);

Loading…
Cancel
Save