diff --git a/app/scripts/services/graph.js b/app/scripts/services/graph.js index 7f7aa7980..1cd1ca32a 100644 --- a/app/scripts/services/graph.js +++ b/app/scripts/services/graph.js @@ -1291,15 +1291,18 @@ angular.module('icestudio') return new Promise(function(resolve) { _.each(cells, function(cell) { var cellView; - if ((cell.get('type') === 'ice.Code') || - (cell.get('type') === 'ice.Generic') || - (cell.get('type') === 'ice.Constant')) - { + if (cell.get('type') === 'ice.Code') { + cellView = paper.findViewByModel(cell); + cellView.$box.find('.code-content').removeClass('highlight-error'); + cellView.clearAnnotations(); + } + else if (cell.get('type') === 'ice.Generic') { + cellView = paper.findViewByModel(cell); + cellView.$box.removeClass('highlight-error'); + } + else if (cell.get('type') === 'ice.Constant') { cellView = paper.findViewByModel(cell); cellView.$box.removeClass('highlight-error'); - if (cell.get('type') === 'ice.Code') { - cellView.clearAnnotations(); - } } }); resolve(); @@ -1311,8 +1314,7 @@ angular.module('icestudio') _.each(cells, function(cell) { var blockId, cellView; if ((codeError.blockType === 'code' && cell.get('type') === 'ice.Code') || - (codeError.blockType === 'constant' && cell.get('type') === 'ice.Constant')) - { + (codeError.blockType === 'constant' && cell.get('type') === 'ice.Constant')) { blockId = utils.digestId(cell.id); } else if (codeError.blockType === 'generic' && cell.get('type') === 'ice.Generic') { @@ -1321,7 +1323,12 @@ angular.module('icestudio') if (codeError.blockId === blockId) { cellView = paper.findViewByModel(cell); if (codeError.type === 'error') { - cellView.$box.addClass('highlight-error'); + if (cell.get('type') === 'ice.Code') { + cellView.$box.find('.code-content').addClass('highlight-error'); + } + else { + cellView.$box.addClass('highlight-error'); + } } if (cell.get('type') === 'ice.Code') { cellView.setAnnotation(codeError); diff --git a/app/styles/design.css b/app/styles/design.css index 04e8bd2f3..298a1c69d 100644 --- a/app/styles/design.css +++ b/app/styles/design.css @@ -484,7 +484,7 @@ g { } .highlight-error { - background: #ff8084; + background: #ff8084 !important; } .highlight-yellow {