Skip to content

Commit

Permalink
Fix layoutpages configuration
Browse files Browse the repository at this point in the history
Fix rendering layoutpages items when update configuration
  • Loading branch information
oRIOnTx authored Apr 15, 2023
1 parent d6ec268 commit 6fec03e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/views/alchemy/admin/pages/update.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@
<% else -%>

if (page) {
var page_html = "<%= j render('page', page: @page) %>".replace(/__ID__/g, "<%= @page.id %>");;
var compiler = Handlebars.compile(page_html);
var tree = <%== @tree.to_json %>;
page.outerHTML = compiler(tree.pages[0]);

<% if @page.layoutpage %>
page.outerHTML = "<%= j render('alchemy/admin/layoutpages/layoutpage, layoutpage: @page) %>"
<% else %>
const page_html = "<%= j render('page', page: @page) %>".replace(/__ID__/g, "<%= @page.id %>");
const compiler = Handlebars.compile(page_html);
const tree = <%== @tree.to_json %>;
page.outerHTML = compiler(tree.pages[0]);
<% end %>

Alchemy.growl("<%= j @notice %>");
Alchemy.closeCurrentDialog();
} else {
Expand Down

0 comments on commit 6fec03e

Please sign in to comment.