fix(builder): activar free drag persistente para template restaurante
This commit is contained in:
@@ -2942,7 +2942,6 @@ const state = {
|
||||
}
|
||||
async function saveContent(){
|
||||
if (isSaving) return;
|
||||
state.settings.free_drag = false;
|
||||
isSaving = true;
|
||||
const btn = document.getElementById("btnSave");
|
||||
if (btn){
|
||||
@@ -2982,6 +2981,11 @@ const state = {
|
||||
const keepRubro = normalizeRubro(state.settings.business_rubro || SERVER_RUBRO || "restaurante");
|
||||
state.blocks = [];
|
||||
state.settings = { ...defaultSettings, business_rubro: keepRubro };
|
||||
if (BUILDER_MODE === "ub24"){
|
||||
state.settings.free_drag = false;
|
||||
} else {
|
||||
state.settings.free_drag = keepRubro === "restaurante";
|
||||
}
|
||||
selectedBlockId = null;
|
||||
renderInspector();
|
||||
renderPreview();
|
||||
@@ -2995,8 +2999,6 @@ const state = {
|
||||
}
|
||||
}
|
||||
function init(){
|
||||
// By default we keep section flow layout for stable full-page composition.
|
||||
state.settings.free_drag = false;
|
||||
const initialRubro = normalizeRubro(state.settings.business_rubro || SERVER_RUBRO || "restaurante");
|
||||
state.settings.business_rubro = initialRubro;
|
||||
state.blocks = normalizeLoadedBlocks(state.blocks);
|
||||
@@ -3009,9 +3011,10 @@ const state = {
|
||||
}
|
||||
if (BUILDER_MODE === "ub24"){
|
||||
state.blocks.forEach(b=>{ if (!b.page) b.page = "home"; });
|
||||
}
|
||||
if (BUILDER_MODE === "ub24"){
|
||||
state.settings.free_drag = false;
|
||||
} else {
|
||||
// Restaurante usa posicionamiento libre para colocar bloques donde el usuario quiera.
|
||||
state.settings.free_drag = initialRubro === "restaurante";
|
||||
}
|
||||
selectedBlockId = null;
|
||||
wireSidebar();
|
||||
@@ -3034,6 +3037,11 @@ const state = {
|
||||
const t = templates[key];
|
||||
state.settings = { ...state.settings, ...t.settings };
|
||||
state.settings.business_rubro = normalizeRubro(key);
|
||||
if (BUILDER_MODE === "ub24"){
|
||||
state.settings.free_drag = false;
|
||||
} else {
|
||||
state.settings.free_drag = state.settings.business_rubro === "restaurante";
|
||||
}
|
||||
state.blocks = t.blocks.map(b=>({ ...b, id: makeId(), page: (BUILDER_MODE==="ub24" ? "home" : b.page) }));
|
||||
selectedBlockId = null;
|
||||
renderInspector(); renderPreview();
|
||||
|
||||
Reference in New Issue
Block a user