Issue #453Opened October 26, 2017by deffrin0 reactions

Previously saved css rules not showing in Style Manager

Question

Previously saved css rules using remote method are not showing in Style Manager.

remote json response

{"gjs-assets":"","gjs-css":"*{box-sizing: border-box;}body{margin:0;}#c743{background-color:#b0aeae;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#c743{background-color:rgb(76, 70, 70);}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#c743{background-color:rgb(234, 38, 10);}#c838{background-color:rgb(83, 19, 215);}.row{display:table;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;width:100%;}.cell{width:8%;display:table-cell;height:75px;}@media (max-width: 768px){.cell{width:100%;display:block;}}","gjs-styles":"","gjs-html":"<div class=\"row\"><div class=\"cell\" id=\"c743\"><\/div><\/div><div class=\"row\"><div class=\"cell\" id=\"c838\"><\/div><\/div>","gjs-components":""}

At the same time this css rules are applied correctly to the content of editor.

When new styles are applied to overwrite the existing css using Style Manager, the newly created css rules are not replacing corresponding existing css rule.

editor.getCss() returns both old and new css rules.

Answers (3)

artfOctober 27, 20170 reactions

Post the grapesjs config and its version

deffrinOctober 27, 20170 reactions
var editor = grapesjs.init({
    
    container : '#gjs',
    plugins: ['gjs-blocks-basic'],
    
   // protectedCss: '',

        storageManager: {
          type: 'remote',
          stepsBeforeSave: 10,
          autoload: true,
          urlLoad: base_url+'superadmin/educationalContent/get_learn_page/'+<?php echo $concept_id; ?>,
          contentTypeJson:true,
          params: {},   // For custom values on requests
        },

        assetManager: {
          assets: 
          <?php echo $new_images; ?>
     /*  'http://placehold.it/350x250/78c5d6/fff/image1.jpg',
       // Pass an object with your properties
       {
         type: 'image',
         src: 'http://placehold.it/350x250/459ba8/fff/image2.jpg',
         height: 350,
         width: 250
       },
       {
         // As the 'image' is the base type of assets, omitting it will
         // be set as `image` by default
         src: 'http://placehold.it/350x250/79c267/fff/image3.jpg',
         height: 350,
         width: 250
     },*/
    ,
    noAssets: 'No assets',
    upload: base_url+'superadmin/qsm/upload/uploadGrapes',
    uploadName:'file',
    autoAdd: 1,
    dropzone: 1,
  },



});

Version : 0.12.17

artfMarch 8, 20180 reactions

To try with the latest version

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.