Merge branch 'color-variables' of github.com:RocketChat/Rocket.Chat into color-variables

pull/7748/head
Karl Prieb 8 years ago
commit 0ba4e4b9dd
  1. 5
      packages/rocketchat-ui-master/client/main.js
  2. 8
      packages/rocketchat-ui-master/server/dynamic-css.js

@ -1,9 +1,8 @@
/* globals toolbarSearch, menu, isRtl, fireGlobalEvent, CachedChatSubscription, DynamicCss */
import Clipboard from 'clipboard';
if (!DynamicCss.test()) {
RocketChat.settings.collection.find({_id:'theme-custom-variables'}, {fields:{ value: 1 }}).observe({changed: () => { DynamicCss.run(true); }});
}
RocketChat.settings.collection.find({_id:'theme-custom-variables'}, {fields:{ value: 1 }}).observe({changed: () => { DynamicCss.run(true); }});
Template.body.onRendered(function() {
new Clipboard('.clipboard');

@ -17,7 +17,11 @@ export default () => {
};
};
const cssVarPoly = {
test() { return window.CSS && window.CSS.supports && window.CSS.supports('(--foo: red)'); },
init() {
if (this.test()) {
return;
}
console.time('cssVarPoly');
cssVarPoly.ratifiedVars = {};
cssVarPoly.varsByBlock = [];
@ -146,10 +150,14 @@ export default () => {
}, 100);
DynamicCss = typeof DynamicCss !=='undefined'? DynamicCss : {};
<<<<<<< HEAD
DynamicCss.test = () => window.CSS && window.CSS.supports && window.CSS.supports('(--foo: red)');
DynamicCss.run = debounce((replace = false) => {
=======
DynamicCss.run = debounce((replace = false) => {
>>>>>>> 2aa991faeef52dd99e3e0bdde1aa04f5b0d110f7
if (replace) {
document.querySelector('#css-variables').innerHTML = RocketChat.settings.get('theme-custom-variables');
}

Loading…
Cancel
Save