Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add last crash line if the value is Never

  • Loading branch information...
commit e2316b406472017487419620b6f2e255749fa0cc 1 parent 3c1c7ce
Pascal Chevrel authored

Showing 2 changed files with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +6 1 js/data.js
  2. +1 1  templates/index.html
7 js/data.js
@@ -77,7 +77,7 @@ calculateTotalTime = function(healthreport, historically) {
77 77 },
78 78 getLastCrashDate = function(days) {
79 79 var sortedDates = sortDates(days, true),
80   - lastCrashDate = 'No crashes recorded';
  80 + lastCrashDate = 'Never';
81 81
82 82 // Loop through the dates from latest to eldest.
83 83 for(var day in sortedDates) {
@@ -375,6 +375,11 @@ var populateData = function(healthreport) {
375 375 plugins.push(pluginsInfo.enabled);
376 376 plugins.push(pluginsInfo.disabled);
377 377
  378 + // Hide last crash list item if there was no crash
  379 + if (getLastCrashDate(healthreport.data.days) == 'Never') {
  380 + document.getElementById('last_crash').style.display = 'none';
  381 + }
  382 +
378 383 // Populate vital statistics
379 384 vitalStatsValueContainers.each(function(index) {
380 385 $(this).text(vitalStats[index]);
2  templates/index.html
@@ -63,7 +63,7 @@
63 63 <ul id="vital_stats">
64 64 <li>{{ _("version") }}<span class="statsBoxSection-value"></span></li>
65 65 <li>{{ _("time open") }}<span class="statsBoxSection-value"></span></li>
66   - <li>{{ _("last crash") }}<span class="statsBoxSection-value"></span></li>
  66 + <li id="last_crash">{{ _("last crash") }}<span class="statsBoxSection-value"></span></li>
67 67 <li>{{ _("bookmarks") }}<span class="statsBoxSection-value"></span></li>
68 68 </ul>
69 69 </div>

0 comments on commit e2316b4

Please sign in to comment.
Something went wrong with that request. Please try again.