Skip to content

Commit

Permalink
Item13339: icons were getting stuck even after problems resolved due …
Browse files Browse the repository at this point in the history
…to poor management of the level tags
  • Loading branch information
cdot committed Apr 27, 2017
1 parent 6f8e46e commit d1039f7
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -161,6 +161,18 @@ function _id_ify(id) {
// on the given tab
function forget_checker_reports($tab, level, id) {
$tab.removeClass(level + id);

// See if any other reports at the same level are extant,
// otherwise remove the level class e.g. 'errors' or 'warnings'
// This will remove th icon
var i, cls = $tab.attr("class").split(/ +/);
for (i = 0; i < cls.length; i++) {
if (cls[i].startsWith(level + 'i-'))
break;
}
if (i == cls.length)
$tab.removeClass(level);

var report_data = $tab.data('reports');
report_data[level][id]--;
if (report_data[level][id]) {
Expand Down Expand Up @@ -257,7 +269,7 @@ function _id_ify(id) {
return;
}

// Remove all existing reports related to these keys
// Remove all existing reports related to this path
id = _id_ify(r.keys);
$('.' + id + '_report').remove();
$('.errors' + id).each(function() {
Expand Down

0 comments on commit d1039f7

Please sign in to comment.