Skip to content

Commit

Permalink
Merge pull request #482 from trln/TD-1402-vendor-chosen
Browse files Browse the repository at this point in the history
Fix keyboard nav & icons for Chosen fields in Advanced Search. Fixes …
  • Loading branch information
kazymovae authored Dec 16, 2024
2 parents 482fddc + 259b097 commit 4032d96
Show file tree
Hide file tree
Showing 9 changed files with 1,858 additions and 15 deletions.
12 changes: 2 additions & 10 deletions app/assets/javascripts/trln_argon/advanced_search_select.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
Blacklight.onLoad(function() {
$('.advanced-search-facet-select').chosen({
allow_single_deselect: true,
no_results_text: 'No results matched'
no_results_text: 'No results matched',
width: '100%'
});

resizeChosen();
jQuery(window).on('resize', resizeChosen);
});

function resizeChosen() {
$(".chosen-container").each(function() {
$(this).attr('style', 'width: 100%');
});
}
2 changes: 1 addition & 1 deletion app/assets/javascripts/trln_argon/trln_argon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//= require trln_argon/progressive_links.js
//= require trln_argon/physical_media_facet.js
//= require bootstrap
//= require chosen-jquery
//= require chosen.jquery.js
//= require blacklight/hierarchy/hierarchy.js
//= require trln_argon/location_facet.js
//= require trln_argon/advanced_search_select.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

@import 'font-awesome';

// Must specify .css extension to disambiguate from chosen.scss
// https://github.com/trln/chosen-rails/blob/remove-sassc/vendor/assets/stylesheets/chosen.css
@import 'chosen.css';
1 change: 0 additions & 1 deletion lib/trln_argon/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require 'rails_autolink'
require 'library_stdnums'
require 'font-awesome-rails'
require 'chosen-rails'
require 'rsolr'
require 'addressable'

Expand Down
1 change: 0 additions & 1 deletion trln_argon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Gem::Specification.new do |s|
s.add_dependency 'rsolr', '>= 1.0', '< 3'
s.add_dependency 'addressable', '~> 2.5'
s.add_dependency 'sprockets', '~> 4.0'
s.add_dependency 'trln-chosen-rails', '1.30.0'
s.add_dependency 'citeproc-ruby', '~> 1.1'
s.add_dependency 'csl-styles', '~> 1.0'
s.add_dependency 'bibtex-ruby', '>= 4.4.6', '< 7'
Expand Down
Binary file added vendor/assets/images/chosen-sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vendor/assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4032d96

Please sign in to comment.