Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add last crash line if the value is Never

  • Loading branch information...
commit e2316b406472017487419620b6f2e255749fa0cc 1 parent 3c1c7ce
@pascalchevrel authored
Showing with 7 additions and 2 deletions.
  1. +6 −1 js/data.js
  2. +1 −1  templates/index.html
View
7 js/data.js
@@ -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
2  templates/index.html
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.