kopia lustrzana https://github.com/c9/core
do not stay idle while loading theme css
rodzic
530d8dc934
commit
c29c0b75e0
|
@ -182,15 +182,13 @@ define(function(require, exports, module) {
|
|||
emit("eachTheme", { changed: true });
|
||||
setGeckoMask();
|
||||
|
||||
if (!oldTheme) return;
|
||||
|
||||
var auto = emit("themeChange", {
|
||||
theme: theme,
|
||||
oldTheme: oldTheme,
|
||||
type: type
|
||||
}) !== false;
|
||||
|
||||
if (noquestion) return;
|
||||
if (!oldTheme || noquestion) return;
|
||||
|
||||
if (auto)
|
||||
return emit("themeDefaults", { theme: theme, type: type });
|
||||
|
|
|
@ -73,9 +73,10 @@ define(function(require, exports, module) {
|
|||
});
|
||||
|
||||
preload(function(err) {
|
||||
register(null, {
|
||||
"layout.preload": plugin
|
||||
});
|
||||
});
|
||||
|
||||
register(null, {
|
||||
"layout.preload": plugin
|
||||
});
|
||||
}
|
||||
});
|
|
@ -139,18 +139,20 @@ define(function(require, exports, module) {
|
|||
settings.on("user/output", setSettings);
|
||||
|
||||
layout.on("themeChange", function(e) {
|
||||
var skin = e.oldTheme;
|
||||
if (!(settings.get("user/output/@backgroundColor") == defaults[skin][0] &&
|
||||
settings.get("user/output/@foregroundColor") == defaults[skin][1] &&
|
||||
settings.get("user/output/@selectionColor") == defaults[skin][2]))
|
||||
var colors = defaults[e.oldTheme];
|
||||
if (!colors) return;
|
||||
if (!(settings.get("user/output/@backgroundColor") == colors[0] &&
|
||||
settings.get("user/output/@foregroundColor") == colors[1] &&
|
||||
settings.get("user/output/@selectionColor") == colors[2]))
|
||||
return false;
|
||||
});
|
||||
|
||||
layout.on("themeDefaults", function(e) {
|
||||
var skin = e.theme;
|
||||
settings.set("user/output/@backgroundColor", defaults[skin][0]);
|
||||
settings.set("user/output/@foregroundColor", defaults[skin][1]);
|
||||
settings.set("user/output/@selectionColor", defaults[skin][2]);
|
||||
var colors = defaults[e.theme];
|
||||
if (!colors) return;
|
||||
settings.set("user/output/@backgroundColor", colors[0]);
|
||||
settings.set("user/output/@foregroundColor", colors[1]);
|
||||
settings.set("user/output/@selectionColor", colors[2]);
|
||||
}, handle);
|
||||
|
||||
// Settings UI
|
||||
|
|
Ładowanie…
Reference in New Issue