grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Urgent : Duplicate other blocks when used custom asset manager

Open vishal5033 opened this issue 9 years ago • 2 comments

Hello, We have modified the Assset manager with custom one. But we are having problem now. If we drop one image into canvase and then add any other component , it will duplicate that component. If we add another image then it would triplet other component.

Can you please help us. Below is the code snippet that we have used to open our custom asset manager.

editor.Commands.add('open-assets', { run: function (editor, sender, opts) { var classofelement = opts.target.attributes.property == "background-image" ? "wrapper" : opts.target.cid; AjaxRequestStart(); $.ajax({ url: '@Url.Action("FilesForm", "File")', type: 'POST', dataType: "html", contentType: "application/json; charset=utf-8", data: JSON.stringify({ classOfSelectedElement: classofelement }), success: function (result) { editor.Modal.open(); $("#gjs-mdl-c").html(result); }, error: function (err, xhr, thrownError) { }, complete: function () { AjaxRequestEnd();
} });

    }
});

vishal5033 avatar Dec 06 '17 11:12 vishal5033

If you get duplicate components only when using your custom Asset Manager, well you should check how you assign the src, I can't help you more

artf avatar Dec 08 '17 12:12 artf

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.

lock[bot] avatar Sep 18 '19 05:09 lock[bot]