[incremental search] using dom.importCssString
This commit is contained in:
parent
724193dcbc
commit
20ff66cf04
1 changed files with 6 additions and 14 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue