diff --git a/src/css_composer/main.js b/src/css_composer/main.js index d2a1775d1..c35832c5a 100644 --- a/src/css_composer/main.js +++ b/src/css_composer/main.js @@ -107,17 +107,18 @@ define(function(require) { * @param {Object} data Object of data to load * @return {Object} Loaded rules */ - load: function(data){ + load: function(data) { var d = data || ''; if(!d && c.stm) d = c.em.getCacheLoad(); var obj = ''; - if(d.style){ + if(d.styles) { try{ - obj = JSON.parse(d.style); + obj = JSON.parse(d.styles); }catch(err){} - }else if(d.css) + } else if (d.css) { obj = c.em.get('Parser').parseCss(d.css); + } if(obj) rules.reset(obj); diff --git a/src/demo.js b/src/demo.js index 1f3afffbc..e26e7e80c 100644 --- a/src/demo.js +++ b/src/demo.js @@ -15,6 +15,12 @@ require(['config/require-config'], function() { fromElement: true, clearOnRender: 0, + storageManager:{ + autoload: 0, + storeComponents: 1, + storeStyles: 1, + }, + /* components: [{ //script: 'var el = this; setInterval(function(){el.style.marginLeft = Math.random() * 50 +"px";}, 1000)', @@ -71,11 +77,6 @@ require(['config/require-config'], function() { }], }], */ - storageManager:{ - autoload: 0, - storeComponents: 1, - storeStyles: 1, - }, commands: { defaults : [{ diff --git a/src/editor/config/config.js b/src/editor/config/config.js index d9f5f949d..e38e38b5a 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -36,7 +36,7 @@ define(function () { width: '100%', // CSS that could only be seen (for instance, inside the code viewer) - protectedCss: '*{box-sizing: border-box;}body{margin:0;height:auto;background:#fff}#wrapper{min-height:100%; overflow:auto}', + protectedCss: '*{box-sizing: border-box;}body{margin:0;height:auto;background-color:#fff}#wrapper{min-height:100%; overflow:auto}', // CSS for the iframe which containing the canvas, useful if you need to custom something inside // (eg. the style of the selected component)