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;
|
return options.$moduleUrls[name] = subst;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.$loading = {};
|
||||||
exports.loadModule = function(moduleName, onLoad) {
|
exports.loadModule = function(moduleName, onLoad) {
|
||||||
var module, moduleType;
|
var module, moduleType;
|
||||||
if (Array.isArray(moduleName)) {
|
if (Array.isArray(moduleName)) {
|
||||||
moduleType = moduleName[0];
|
moduleType = moduleName[0];
|
||||||
moduleName = moduleName[1];
|
moduleName = moduleName[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
module = require(moduleName);
|
module = require(moduleName);
|
||||||
} catch (e) {};
|
} 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);
|
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() {
|
var afterLoad = function() {
|
||||||
require([moduleName], function(module) {
|
require([moduleName], function(module) {
|
||||||
exports._emit("load.module", {name: moduleName, module: 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;
|
var style = this.$printMarginEl.style;
|
||||||
style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px";
|
style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px";
|
||||||
style.visibility = this.$showPrintMargin ? "visible" : "hidden";
|
style.visibility = this.$showPrintMargin ? "visible" : "hidden";
|
||||||
|
|
||||||
if (this.session && this.session.$wrap == -1)
|
if (this.session && this.session.$wrap == -1)
|
||||||
this.adjustWrapLimit();
|
this.adjustWrapLimit();
|
||||||
};
|
};
|
||||||
|
|
@ -1268,6 +1268,8 @@ var VirtualRenderer = function(container, theme) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function afterLoad(theme) {
|
function afterLoad(theme) {
|
||||||
|
if (!theme.cssClass)
|
||||||
|
return;
|
||||||
dom.importCssString(
|
dom.importCssString(
|
||||||
theme.cssText,
|
theme.cssText,
|
||||||
theme.cssClass,
|
theme.cssClass,
|
||||||
|
|
@ -1367,7 +1369,7 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", {
|
||||||
this.$updatePrintMargin();
|
this.$updatePrintMargin();
|
||||||
},
|
},
|
||||||
get: function() {
|
get: function() {
|
||||||
return this.$showPrintMargin && this.$printMarginColumn;
|
return this.$showPrintMargin && this.$printMarginColumn;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showGutter: {
|
showGutter: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue