diff --git a/lib/ace/incremental_search.js b/lib/ace/incremental_search.js index e158b6d5..c7227cdc 100644 --- a/lib/ace/incremental_search.js +++ b/lib/ace/incremental_search.js @@ -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); }