From 1d58e68bbc961b561bc529cea56ba0cce6ddb48c Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 8 Jan 2020 12:13:12 +0100 Subject: [PATCH] Fix updating page preview after element create/save The function has been renamed lately. --- app/views/alchemy/admin/elements/create.js.erb | 2 +- app/views/alchemy/admin/elements/update.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/alchemy/admin/elements/create.js.erb b/app/views/alchemy/admin/elements/create.js.erb index 6db4f595ad..83088b279c 100644 --- a/app/views/alchemy/admin/elements/create.js.erb +++ b/app/views/alchemy/admin/elements/create.js.erb @@ -36,7 +36,7 @@ Alchemy.closeCurrentDialog(); Alchemy.Tinymce.init(<%= @element.richtext_contents_ids.to_json %>); Alchemy.PreviewWindow.refresh(function() { - Alchemy.ElementEditors.selectElementInPreview(<%= @element.id %>); + Alchemy.ElementEditors.focusElementPreview(<%= @element.id %>); }); $el = $('#element_<%= @element.id %>'); diff --git a/app/views/alchemy/admin/elements/update.js.erb b/app/views/alchemy/admin/elements/update.js.erb index 25a570b88f..8b4f9c7c17 100644 --- a/app/views/alchemy/admin/elements/update.js.erb +++ b/app/views/alchemy/admin/elements/update.js.erb @@ -9,7 +9,7 @@ $el.trigger('SaveElement.Alchemy', {previewText: '<%= j sanitize(@element.preview_text) %>'}); Alchemy.growl('<%= Alchemy.t(:element_saved) %>'); Alchemy.PreviewWindow.refresh(function() { - Alchemy.ElementEditors.selectElementInPreview(<%= @element.id %>); + Alchemy.ElementEditors.focusElementPreview(<%= @element.id %>); }); <%- else -%>