Update importCssString so that it can work with remote DOM documents.

This commit is contained in:
Irakli Gozalishvili 2011-09-09 17:56:18 +02:00
commit 190ed05eae

View file

@ -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);