I would like to refresh the page whenever any component drag and dropped into the layout container. I have tried through cq:listener and which custom JavaScript also but both are not working. Could you please let me know if any other ways to achieve this? Thanks
//Sample JS logic tried
(function ($, Granite) {
"use strict";
$(document).on("cq-editable-added", function (event, editable) {
// Check if the component is dropped into your specific container
if (editable && editable.type === "path/of/container") {
console.log("Component added:", editable.type);
// Refresh the page
location.reload();
}
});
})(jQuery, Granite);