Skip to content

Commit

Permalink
Fix one error, and by this show stale years with greyed coloring (refs
Browse files Browse the repository at this point in the history
  • Loading branch information
ut committed Jun 14, 2024
1 parent 37753f5 commit bdd2a60
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
10 changes: 8 additions & 2 deletions app/assets/javascripts/helpers/timeslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ jQuery(function ($) {
for (var i = minYear; i <= maxYear; i += step) {
var div = document.createElement('div');
div.classList.add('year');
div.setAttribute('title', 'Show '+places_by_year[i].length+' places for '+i);
div.setAttribute('id', 'year'+i);
div.setAttribute('data-year', i);
div.setAttribute('data-places', places_by_year[i].length);
if ( places_by_year[i] ) {
div.setAttribute('title', 'Show '+places_by_year[i].length+' places for '+i);
div.setAttribute('data-places', places_by_year[i].length);
} else {
div.classList.add('stale');
div.setAttribute('title', 'No places for '+i);
div.setAttribute('data-places', 0);
}
div.textContent = i;
timelineContent.appendChild(div);
}
Expand Down
7 changes: 7 additions & 0 deletions app/assets/stylesheets/6_timeline.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ table#timeline-list {
align-items: center;
align-items: flex-end;
}

#timeline-wrapper.dark #timeline-content,
#timeline-wrapper.light #timeline-content {
background-color: transparent;
Expand Down Expand Up @@ -170,6 +171,12 @@ table#timeline-list {
filter: drop-shadow(0 0 0.2em white);
transition: 0.3s all;
}
#timeline-wrapper #timeline-content div.stale,
#timeline-wrapper.light #timeline-content div.stale,
#timeline-wrapper.dark #timeline-content div.stale {
color: #aaa !important;
border-color: #bbb !important;
}
#timeline-wrapper #timeline-content div:hover
{
color: #ccc;
Expand Down
2 changes: 1 addition & 1 deletion app/views/maps/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
%script{:type => "text/javascript"}
let places_by_year = #{@places_by_year.to_json.html_safe}
console.log('places_by_year',places_by_year.length, places_by_year);
console.log('places_by_year',places_by_year);
#selection{:data => { 'url' => "/maps/#{@map.id}.json", 'map_id' => "#{@map.id}", 'map-center-lat' => "#{@map.mapcenter_lat}", 'map-center-lon' => "#{@map.mapcenter_lon}", 'map-zoom' => "#{@map.zoom}", 'map-extent-northeast' => "#{@map.northeast_corner}", 'map-extent-southwest' => "#{@map.southwest_corner}", 'map-basemap-url' => "#{@map.basemap_url}", 'map-basemap-attribution' => "#{@map.basemap_attribution}", 'map-background-color' => "#{@map.background_color}", 'map-popup-display-mode' => "#{@map.popup_display_mode}", 'map-marker_display_mode' => "#{@map.marker_display_mode}", 'map-enable_historical_maps' => "#{@map.enable_historical_maps}", 'map-enable_time_slider' => "#{@map.enable_time_slider}", 'map-timeline-minyear' => "#{@minyear}", 'map-timeline-maxyear' => "#{@maxyear}", 'map-timeline-timespan' => "#{@timespan}" }}
Expand Down

0 comments on commit bdd2a60

Please sign in to comment.