Issue #1258Opened July 4, 2018by YashPrince0 reactions

Style is not copying after cloning the element after Save

Question

Hi @artf. At the first time before saving the template, When I make one element and clone it, the style is coming in the clonned element. That is running fine. But when I save the template using Ajax and Call the below code:-

const LandingPage = {
     html: editor.getHtml(),
     css: editor.getCss(),
     components: null,
     style: null,
   };
     $.ajax({
         type: "POST",
         url: BASE_API_URLss+"/api/addTemplateBuilder",
         headers: {
             'Authorization' : "Bearer " + this.userJson.token
         },
         data: {
             content: LandingPage.html,
             css: LandingPage.css, 
          
         },
         beforeSend: function() 
         {
             $('.save_template_btn').addClass('loading');
         },
         success: function(response)
         {
             editor.setComponents(response.content);
             editor.setStyle(response.css);
      
         },
         error: function(jqXHR, textStatus, errorThrown) 
         { 
            
         }
     });


and then clone the elements, their styling does not applies to the cloned elements. If I comment the editor.setComponents(response.content); and editor.setStyle(response.css); in success function then styling applies to the cloned elements but still does not style applies to the cloned elements after page refresh after save as editor.setComponents(response.content); and editor.setStyle(response.css); on page load and editor init . clonederror

Thanks for help in advance

Answers (2)

artfJuly 11, 20180 reactions

Follow the issue template and provide a live demo

lock[bot]September 17, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.