Changeset 39dc0a6 in OpenWorkouts-current
- Timestamp:
- Mar 12, 2019, 11:20:44 PM (5 years ago)
- Branches:
- current
- Children:
- e52a502
- Parents:
- 3ac70ca
- Location:
- ow
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/static/js/ow.js
r3ac70ca r39dc0a6 464 464 465 465 var chart_selector = spec.chart_selector, 466 tooltip_selector = spec.tooltip_selector, 466 467 url = spec.url, 467 468 day_names_list = spec.day_names_list; … … 491 492 492 493 // Hide the tooltip 493 $( '.js-calendar-heatmap-tooltip').hide()494 $(tooltip_selector).hide() 494 495 495 496 var chart = d3.select(chart_selector); … … 594 595 d3.select(this).classed('hover', true); 595 596 var day = find_day(d); 596 $( '.js-ch-tooltip-date').html(titleFormat(new Date(d)));597 $(tooltip_selector + '-date').html(titleFormat(new Date(d))); 597 598 if (day != undefined) { 598 $( '.js-ch-tooltip-workouts').html(day.workouts);599 $( '.js-ch-tooltip-time').html(day.time_formatted);600 $( '.js-ch-tooltip-distance').html(day.distance_formatted);601 $( '.js-ch-tooltip-elevation').html(day.elevation_formatted);599 $(tooltip_selector + '-workouts').html(day.workouts); 600 $(tooltip_selector + '-time').html(day.time_formatted); 601 $(tooltip_selector + '-distance').html(day.distance_formatted); 602 $(tooltip_selector + '-elevation').html(day.elevation_formatted); 602 603 } 603 604 else { 604 $( '.js-ch-tooltip-workouts').html(' - ');605 $( '.js-ch-tooltip-time').html(' - ');606 $( '.js-ch-tooltip-distance').html(' - ');607 $( '.js-ch-tooltip-elevation').html(' - ');608 } 609 $( '.js-calendar-heatmap-tooltip').fadeIn('fast');605 $(tooltip_selector + '-workouts').html(' - '); 606 $(tooltip_selector + '-time').html(' - '); 607 $(tooltip_selector + '-distance').html(' - '); 608 $(tooltip_selector + '-elevation').html(' - '); 609 } 610 $(tooltip_selector).stop( true, true ).fadeIn('fast'); 610 611 }) 611 612 .on("mouseout", function(d) { 612 613 d3.select(this).classed('hover', false); 613 $( '.js-calendar-heatmap-tooltip').fadeOut('fast');614 $(tooltip_selector).stop( true, true ).fadeOut('fast'); 614 615 }) 615 616 .datum(format); -
ow/templates/profile.pt
r3ac70ca r39dc0a6 53 53 <div class="calendar-heatmap js-calendar-heatmap"> 54 54 </div> 55 <div class="calendar-heatmap-tooltip js-c alendar-heatmap-tooltip">55 <div class="calendar-heatmap-tooltip js-ch-tooltip"> 56 56 <ul class="profile-data"> 57 57 <li> … … 489 489 var heatmap_chart = owjs.calendar_heatmap_chart({ 490 490 chart_selector: 'div.js-calendar-heatmap', 491 tooltip_selector: '.js-ch-tooltip', 491 492 url: "${request.resource_url(user, 'month')}", 492 493 // Trick to have all those shortened day names translated
Note: See TracChangeset
for help on using the changeset viewer.