fix theme==undefined in cloud9 splitview
This commit is contained in:
parent
339bf10335
commit
9cc74437c2
2 changed files with 21 additions and 4 deletions
|
|
@ -93,22 +93,37 @@ exports.setModuleUrl = function(name, subst) {
|
|||
return options.$moduleUrls[name] = subst;
|
||||
};
|
||||
|
||||
exports.$loading = {};
|
||||
exports.loadModule = function(moduleName, onLoad) {
|
||||
var module, moduleType;
|
||||
if (Array.isArray(moduleName)) {
|
||||
moduleType = moduleName[0];
|
||||
moduleName = moduleName[1];
|
||||
}
|
||||
|
||||
try {
|
||||
module = require(moduleName);
|
||||
} catch (e) {};
|
||||
if (module)
|
||||
// require(moduleName) can return empty object if called after require([moduleName], callback)
|
||||
if (module && !exports.$loading[moduleName])
|
||||
return onLoad && onLoad(module);
|
||||
|
||||
if (!exports.$loading[moduleName])
|
||||
exports.$loading[moduleName] = [];
|
||||
|
||||
exports.$loading[moduleName].push(onLoad);
|
||||
|
||||
if (exports.$loading[moduleName].length > 1)
|
||||
return;
|
||||
|
||||
var afterLoad = function() {
|
||||
require([moduleName], function(module) {
|
||||
exports._emit("load.module", {name: moduleName, module: module});
|
||||
onLoad && onLoad(module);
|
||||
var listeners = exports.$loading[moduleName];
|
||||
exports.$loading[moduleName] = null;
|
||||
listeners.forEach(function(onLoad) {
|
||||
onLoad && onLoad(module);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
var style = this.$printMarginEl.style;
|
||||
style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px";
|
||||
style.visibility = this.$showPrintMargin ? "visible" : "hidden";
|
||||
|
||||
|
||||
if (this.session && this.session.$wrap == -1)
|
||||
this.adjustWrapLimit();
|
||||
};
|
||||
|
|
@ -1268,6 +1268,8 @@ var VirtualRenderer = function(container, theme) {
|
|||
}
|
||||
|
||||
function afterLoad(theme) {
|
||||
if (!theme.cssClass)
|
||||
return;
|
||||
dom.importCssString(
|
||||
theme.cssText,
|
||||
theme.cssClass,
|
||||
|
|
@ -1367,7 +1369,7 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", {
|
|||
this.$updatePrintMargin();
|
||||
},
|
||||
get: function() {
|
||||
return this.$showPrintMargin && this.$printMarginColumn;
|
||||
return this.$showPrintMargin && this.$printMarginColumn;
|
||||
}
|
||||
},
|
||||
showGutter: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue