From 586ff85796bfbfa21b904256aed15acfe7c7f09f Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 1 May 2015 14:38:25 -0400 Subject: [PATCH] Fixing min-height issues --- src/definitions/modules/dropdown.js | 8 ++++++-- src/themes/default/modules/dropdown.variables | 16 ++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 8ffa02d83..70f110577 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -1230,6 +1230,9 @@ $.fn.dropdown = function(parameters) { query: function() { return $.trim($search.val()); }, + searchWidth: function(characterCount) { + return (characterCount * settings.glyphWidth) + 'em'; + }, selectionCount: function() { var values = module.get.values() @@ -1596,8 +1599,8 @@ $.fn.dropdown = function(parameters) { ? module.get.query() : '', hasSearchValue = (typeof searchValue === 'string' && searchValue.length > 0), - searchWidth = (searchValue.length * settings.glyphWidth) + 'em', - valueIsSet = $input.val() !== '' + searchWidth = module.get.searchWidth(searchValue.length), + valueIsSet = searchValue !== '' ; if(isMultiple && hasSearchValue) { module.verbose('Adjusting input width', searchWidth, settings.glyphWidth); @@ -2034,6 +2037,7 @@ $.fn.dropdown = function(parameters) { searchTerm: function() { module.verbose('Cleared search term'); $search.val(''); + module.set.filtered(); }, selected: function(value) { var diff --git a/src/themes/default/modules/dropdown.variables b/src/themes/default/modules/dropdown.variables index 3c1585294..9577f7018 100644 --- a/src/themes/default/modules/dropdown.variables +++ b/src/themes/default/modules/dropdown.variables @@ -91,7 +91,7 @@ @menuInputPadding: @menuInputVerticalPadding @menuInputHorizontalPadding; /* Menu Image */ -@menuImageMaxHeight: 2.5em; +@menuImageMaxHeight: 2em; /* Item Sub-Element */ @itemElementFloat: none; @@ -227,14 +227,14 @@ /* Multiple */ -/* Split Actual Padding Between Child and Group (allows for label spacing) */ -@multipleSelectionVerticalPadding: (@searchSelectionVerticalPadding * (4/9)); +/* Split Actual Padding Between Child and Parent (allows for label spacing) */ +@multipleSelectionVerticalPadding: (@searchSelectionVerticalPadding * (1/3)); @multipleSelectionLeftPadding: (@selectionHorizontalPadding - @labelHorizontalPadding); @multipleSelectionRightPadding: @selectionIconDistance; @multipleSelectionPadding: @multipleSelectionVerticalPadding @multipleSelectionRightPadding @multipleSelectionVerticalPadding @multipleSelectionLeftPadding; /* Child Elements */ -@multipleSelectionChildVerticalMargin: (@searchSelectionVerticalPadding * (5/9)); +@multipleSelectionChildVerticalMargin: (@searchSelectionVerticalPadding * (2/3)); @multipleSelectionChildSpacing: 0.4285em; @multipleSelectionChildMargin: @multipleSelectionChildVerticalMargin 0em @multipleSelectionChildVerticalMargin @multipleSelectionChildSpacing; @multipleSelectionChildLineHeight: @searchSelectionLineHeight; @@ -245,13 +245,13 @@ @multipleSelectionDropdownIconPadding: 0.5em; /* Selection Label */ -@labelSize: @relativeSmall; -@labelHorizontalSpacing: 0.46153em; /* 6px @ 13px/em */ -@labelVerticalSpacing: (0.46153em / 2); +@labelSize: @relativeMedium; +@labelHorizontalSpacing: 0.2857142rem; /* 4px @ 14px/rem */ +@labelVerticalSpacing: (0.2857142em / 2); @labelMargin: @labelVerticalSpacing @labelHorizontalSpacing @labelVerticalSpacing 0em; @labelBoxShadow: 0px 0px 0px 1px @borderColor inset; -@labelVerticalPadding: 0.3846em; /* 5px @ 13px/em */ +@labelVerticalPadding: 0.35714em; /* 5px @ 14px/em */ @labelHorizontalPadding: @relativeMini; @labelPadding: @labelVerticalPadding @labelHorizontalPadding;