From e7a9b4f8a6b5f8730a0645cf5211fc3cf260defb Mon Sep 17 00:00:00 2001 From: Anmol Wassan Date: Thu, 5 Oct 2017 15:19:51 +0000 Subject: [PATCH 1/2] Proposed patch for issue #11 --- dist/js/sth-select.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dist/js/sth-select.js b/dist/js/sth-select.js index cb8d54f..012f13b 100644 --- a/dist/js/sth-select.js +++ b/dist/js/sth-select.js @@ -152,7 +152,13 @@ _renderList(); var height = _calculatePopupHeight(); - _$popup.animate({ height: height }, 500); + if(height == MAX_HEIGHT) { + _$popup.css({'height':'auto'}); + height = _$popup.height(); + _$popup.animate({ height:height}, 500); + } + else + _$popup.animate({ height: height }, 500); } /** @@ -381,4 +387,4 @@ $(document).ready(function loadFromHtmlAPI() { function boolFromString(string) { return string == "true"; } -}); \ No newline at end of file +}); From 96cb1a52b192f20b5adfeb1c2e6d3f3e5aa8d09c Mon Sep 17 00:00:00 2001 From: Anmol Wassan Date: Sun, 8 Oct 2017 07:15:46 +0000 Subject: [PATCH 2/2] Updated patch considering select has a filter --- dist/js/sth-select.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dist/js/sth-select.js b/dist/js/sth-select.js index 012f13b..5655024 100644 --- a/dist/js/sth-select.js +++ b/dist/js/sth-select.js @@ -152,13 +152,7 @@ _renderList(); var height = _calculatePopupHeight(); - if(height == MAX_HEIGHT) { - _$popup.css({'height':'auto'}); - height = _$popup.height(); - _$popup.animate({ height:height}, 500); - } - else - _$popup.animate({ height: height }, 500); + _$popup.animate({ height: height }, 500); } /** @@ -224,7 +218,11 @@ var popupHeight = _calculatePopupHeight(); var titleHeight = _$title.outerHeight(); - _$content.outerHeight(popupHeight - titleHeight); + var filterHeight = _$filter.outerHeight(); + var contentHeight = (popupHeight - titleHeight); + if(_properties.hasFilter) + contentHeight = contentHeight - filterHeight; + _$content.outerHeight(contentHeight); } /**