Skip to content

Commit

Permalink
Merge pull request #1710 from tvdeyen/fix-element-preview-update
Browse files Browse the repository at this point in the history
Fix updating page preview after element create/save
  • Loading branch information
tvdeyen authored Jan 8, 2020
2 parents 859ecda + 1d58e68 commit 09adeec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/elements/create.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>');
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/elements/update.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%>
Expand Down

0 comments on commit 09adeec

Please sign in to comment.