[incremental search] using dom.importCssString

This commit is contained in:
Robert Krahn 2013-03-16 17:58:39 -07:00
commit 20ff66cf04

View file

@ -186,23 +186,15 @@ exports.IncrementalSearch = IncrementalSearch;
*
**/
var dom = require('./lib/dom');
function patchHighlightMarkerStyling(options) {
options = options || {};
var id = 'incremental-search-highlight-style-patch',
style = document.getElementById(id);
if (style) {
if (options.enable) return;
style.parentNode.removeChild(style);
return;
}
if (!options.enable) return;
style = document.createElement('style');
style.setAttribute('id', id);
style.textContent = "div.ace_selected-word {\n"
+ " background-color: orange !important;\n"
+ " border: 0 !important;"
+ "}\n"
document.getElementsByTagName('head')[0].appendChild(style);
css = 'div.ace_selected-word {\n'
+ ' background-color: orange !important;\n'
+ ' border: 0 !important;\n'
+ '}\n'
dom.importCssString(css, id);
}