Skip to content

Commit

Permalink
Merge pull request #33 from sul-dlss/disable-page
Browse files Browse the repository at this point in the history
disable pagination links, and replace count immediately
  • Loading branch information
mejackreed committed Jul 13, 2016
2 parents c2d8b3b + 224be35 commit 0d90c31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/blacklight_heatmaps/viewers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Blacklight.onLoad(function () {
var template = $el.data().sidebarTemplate;
var colorRamp = $el.data().colorRamp;

// Blank out page link content first and disable pagination
$('#sortAndPerPage .page_links').html('');
$('ul.pagination li').addClass('disabled');

var map = L.map($el[0].id).setView([0, 0], 1);
var basemap = L.tileLayer($el.data().basemap, {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
Expand Down
12 changes: 10 additions & 2 deletions spec/features/index_page_map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

feature 'Index page map', js: true do
it 'renders a leaflet map' do
visit search_catalog_path(q: 'strong', view: 'heatmaps')
visit search_catalog_path(q: ' ', view: 'heatmaps', search_field: 'all_fields')
expect(page).to have_css '.leaflet-map-pane'

# Zoomed to world
expect(page).to have_css 'img[src="http://a.basemaps.cartocdn.com/light_all/1/0/0.png"]'

# Disabled pagination
expect(page).to have_css 'ul.pagination li.disabled', count: 6

# Document counts
expect(page).to have_css '.page_links', text: '17 items found'

expect(page).to have_css '#index-map-sidebar', visible: false
page.find('svg g path').click
page.first('svg g path').click
expect(page).to have_css '#index-map-sidebar', visible: true
expect(page)
.to have_css 'h3.media-heading a', text: '"Strong Medicine speaks"'
Expand Down

0 comments on commit 0d90c31

Please sign in to comment.