Update importCssString so that it can work with remote DOM documents.
This commit is contained in:
parent
e5aa00fec9
commit
190ed05eae
1 changed files with 9 additions and 3 deletions
|
|
@ -53,11 +53,11 @@ var RenderLoop = require("ace/renderloop").RenderLoop;
|
|||
var EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||
var editorCss = require("ace/requirejs/text!ace/css/editor.css");
|
||||
|
||||
// import CSS once
|
||||
dom.importCssString(editorCss);
|
||||
|
||||
var VirtualRenderer = function(container, theme) {
|
||||
this.container = container;
|
||||
|
||||
// Imports CSS once per DOM document ('ace_editor' serves as an identifier).
|
||||
dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
|
||||
dom.addCssClass(this.container, "ace_editor");
|
||||
|
||||
this.setTheme(theme);
|
||||
|
|
@ -803,6 +803,12 @@ var VirtualRenderer = function(container, theme) {
|
|||
}
|
||||
|
||||
function afterLoad(theme) {
|
||||
dom.importCssString(
|
||||
theme.cssText,
|
||||
theme.cssClass,
|
||||
_self.container.ownerDocument
|
||||
);
|
||||
|
||||
if (_self.$theme)
|
||||
dom.removeCssClass(_self.container, _self.$theme);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue