Skip to content
Snippets Groups Projects
Commit 744232ee authored by Rodrigo Nascimento's avatar Rodrigo Nascimento Committed by GitHub
Browse files

Merge pull request #6939 from RocketChat/color-compilation

[FIX] Compile CSS color variables
parents 2fa89b15 85492e38
No related branches found
No related tags found
No related merge requests found
......@@ -63,9 +63,9 @@ RocketChat.settings = {
return _(actions).reduceRight(_.wrap, (err, success) => callback(err, success))();
},
load(key, value, initialLoad) {
['*', key].forEach(key => {
if (RocketChat.settings.callbacks[key]) {
RocketChat.settings.callbacks[key].forEach(callback => callback(key, value, initialLoad));
['*', key].forEach(item => {
if (RocketChat.settings.callbacks[item]) {
RocketChat.settings.callbacks[item].forEach(callback => callback(key, value, initialLoad));
}
});
Object.keys(RocketChat.settings.regexCallbacks).forEach(cbKey => {
......
......@@ -71,17 +71,16 @@ RocketChat.theme = new class {
this.compileDelayed = _.debounce(Meteor.bindEnvironment(this.compile.bind(this)), 100);
Meteor.startup(() => {
RocketChat.settings.onAfterInitialLoad(() => {
RocketChat.settings.get('*', Meteor.bindEnvironment((key, value) => {
RocketChat.settings.get(/^theme-./, Meteor.bindEnvironment((key, value) => {
if (key === 'theme-custom-css' && value != null) {
this.customCSS = value;
} else if (/^theme-.+/.test(key) === true) {
} else {
const name = key.replace(/^theme-[a-z]+-/, '');
if (this.variables[name] != null) {
this.variables[name].value = value;
}
} else {
return;
}
this.compileDelayed();
}));
});
......@@ -89,7 +88,6 @@ RocketChat.theme = new class {
}
compile() {
let content = [this.getVariablesAsLess()];
content.push(...this.files.map((name) => Assets.getText(name)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment