Skip to content

Commit

Permalink
fixes a regression where the toggle collapse wasnt working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Nov 4, 2014
1 parent b6187eb commit 36953b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/assets/javascripts/geoblacklight/modules/collapse.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Blacklight.onLoad(function(){
$('.document').each(function(index, value){
Blacklight.onLoad(function() {
$('.document').each(function(index, value) {
value = $(value);
value.find('[data-layer-id]').on('click', function(){
value.find('.collapse').toggle();
value.find('[data-layer-id]').on('click', function() {
value.find('.collapse').collapse('toggle');
});
});
});
});
4 changes: 2 additions & 2 deletions spec/features/split_view.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
expect(page).to have_css(".document", count: 2)
expect(page).to have_css('#map')
end

scenario 'hover on record should produce bounding box on map' do
# Needed to find an svg element on the page
expect(Nokogiri::HTML.parse(page.body).css('path').length).to eq 0
find('.documentHeader', match: :first).trigger(:mouseover)
expect(Nokogiri::HTML.parse(page.body).css('path').length).to eq 1
end

scenario 'click on a record area to expand collapse' do
within('.documentHeader', match: :first) do
expect(page).to_not have_css('.collapse')
Expand Down

0 comments on commit 36953b8

Please sign in to comment.