diff options
author | Rogan Creswick <creswick@gmail.com> | 2013-06-17 16:22:09 -0700 |
---|---|---|
committer | Rogan Creswick <creswick@gmail.com> | 2013-06-17 16:22:09 -0700 |
commit | b27a626b66b98df7177adaca23d691e3bc443a75 (patch) | |
tree | 9603ddb0e3a0cf5881a455cecf6e1c765f839877 /src/js/fiveui | |
parent | 31571c189559c0c8e3247401c358dd7cd0b93734 (diff) |
accounted for background images when highlighting problems
Diffstat (limited to 'src/js/fiveui')
-rw-r--r-- | src/js/fiveui/injected/ui.js | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/js/fiveui/injected/ui.js b/src/js/fiveui/injected/ui.js index 221a979..d75cf20 100644 --- a/src/js/fiveui/injected/ui.js +++ b/src/js/fiveui/injected/ui.js @@ -62,17 +62,33 @@ }, 10); }; + /** + * Temp storage for the old in-line styles on elements. + * + * XXX account for marking multiple elements at once. + * (or use a different approach for marking elements) + */ + core.oldStyle = ''; + core.highlightProblem = function(elt) { core.maskRules(function() { - elt.css('background-color', 'rgba(255,0,0,0.3)') - .addClass('uic-problem'); + core.oldStyle = elt.attr('style'); + console.log('old style: '+core.oldStyle); + + elt.attr('style', 'background-color: rgba(255,0,0,0.3); background-image: none;'); + elt.addClass('uic-problem'); }); }; core.maskProblem = function(elt) { core.maskRules(function() { - elt.css('background-color', '') - .removeClass('uic-problem'); + if (core.oldStyle == undefined) { + elt.removeAttr('style'); + } else { + elt.attr('style', core.oldStyle); + } + + elt.removeClass('uic-problem'); }); }; |