From b5934a854f2a9e7151019d02ccb05a600467a182 Mon Sep 17 00:00:00 2001 From: Benjamin Gross Date: Mon, 9 May 2016 10:34:31 -0600 Subject: [PATCH] Add checkmark to selected dropdown options --- css/browsers.css | 8 ++++++++ css/style.css | 5 +++++ jquery.facetview2.js | 9 +++++++++ 3 files changed, 22 insertions(+) create mode 100644 css/browsers.css diff --git a/css/browsers.css b/css/browsers.css new file mode 100644 index 0000000..e50c4fc --- /dev/null +++ b/css/browsers.css @@ -0,0 +1,8 @@ + +.btn-group.hidden { + display: none !important +} + +.facetview_filters.hidden { + display: none; !important; +} diff --git a/css/style.css b/css/style.css index 1e7c427..f313014 100644 --- a/css/style.css +++ b/css/style.css @@ -70,3 +70,8 @@ td.facetview_filtershow { text-shadow: 0 1px 1px rgba(255, 255, 255, 0.19); -webkit-font-smoothing: antialiased; } + +.dropdown-menu .selected:after { + font-family: "Glyphicons Halflings"; + content:"\0020\e013"; +} diff --git a/jquery.facetview2.js b/jquery.facetview2.js index b098ff9..35febbc 100644 --- a/jquery.facetview2.js +++ b/jquery.facetview2.js @@ -802,6 +802,10 @@ function getUrlVars() { event.preventDefault(); sizechoice = ($(this).attr('id')) + // switch item with 'selected' class + $('.facetview_size_drop', obj).removeClass('selected') + $(this).addClass('selected') + // synchronise the new sort with the options savePageSizeOption(sizechoice); @@ -826,6 +830,11 @@ function getUrlVars() { event.preventDefault(); sortchoice = ($(this).attr('id')) options.behaviour_set_order_by(options, obj, {orderby: sortchoice}) + + // switch item with 'selected' class + $('.facetview_orderby', obj).removeClass('selected') + $(this).addClass('selected') + // $('.dropdown-toggle').html($(this).html() + ''); // synchronise the new sort with the options saveSortOption(sortchoice);