Permalink
Browse files

add last crash line if the value is Never

  • Loading branch information...
1 parent 3c1c7ce commit e2316b406472017487419620b6f2e255749fa0cc @pascalchevrel committed Apr 5, 2013
Showing with 7 additions and 2 deletions.
  1. +6 −1 js/data.js
  2. +1 −1 templates/index.html
View
@@ -77,7 +77,7 @@ calculateTotalTime = function(healthreport, historically) {
},
getLastCrashDate = function(days) {
var sortedDates = sortDates(days, true),
- lastCrashDate = 'No crashes recorded';
+ lastCrashDate = 'Never';
// Loop through the dates from latest to eldest.
for(var day in sortedDates) {
@@ -375,6 +375,11 @@ var populateData = function(healthreport) {
plugins.push(pluginsInfo.enabled);
plugins.push(pluginsInfo.disabled);
+ // Hide last crash list item if there was no crash
+ if (getLastCrashDate(healthreport.data.days) == 'Never') {
+ document.getElementById('last_crash').style.display = 'none';
+ }
+
// Populate vital statistics
vitalStatsValueContainers.each(function(index) {
$(this).text(vitalStats[index]);
View
@@ -63,7 +63,7 @@
<ul id="vital_stats">
<li>{{ _("version") }}<span class="statsBoxSection-value"></span></li>
<li>{{ _("time open") }}<span class="statsBoxSection-value"></span></li>
- <li>{{ _("last crash") }}<span class="statsBoxSection-value"></span></li>
+ <li id="last_crash">{{ _("last crash") }}<span class="statsBoxSection-value"></span></li>
<li>{{ _("bookmarks") }}<span class="statsBoxSection-value"></span></li>
</ul>
</div>

0 comments on commit e2316b4

Please sign in to comment.