Custom brics not saving


#1

When I am editing a custom brick, adding the menu items or editing the html tab, there is a yellow warning triangle that the bric is unsaved. I click the save button to save the edits. If I leave this bric and come back to it, all the edits have reverted to their original state and I lost all changes. do I have to export it every time ? of course making a custom bric means going back and forth to make sure all the functions are correct, so why doesn’t it save ?


#2

Are you referring to building and testing brics or using brics in your Web page? I guess I’m not sure what you’re asking.

You should be able to save either way, but I’m curious what you are asking exactly. Sorry it’s just me not getting it I’m sure.


#3

Hi, no the problem is saving them while building and testing them.


#4

I can’t be certain this is your problem because I haven’t seen the code, but in general the DOM CHANGES section on this docs page should help.

https://help.blocsapp.com/knowledge-base/api-calls/

After a function has made changes to the custom brics DOM, it will need to call the sync protocol in order to synchronise the DOM changes to the custom bric located on the main Blocs design canvas.

window.webkit.messageHandlers.sync.postMessage(“changes”);

Just put this code in your function and you should be able to save.