Sha256: a71a17a18be8aefef753f527a2a40f33bf31d547a061ad1e58148003f211255e

Contents?: true

Size: 1.04 KB

Versions: 33

Compression:

Stored size: 1.04 KB

Contents

(function() {
  var page = document.querySelector('#page_<%= @page.id %>');

<% if @old_page_layout != @page.page_layout -%>
  Alchemy.ElementsWindow.reload();
  Alchemy.growl('<%= j Alchemy.t(:page_layout_changed_notice) %>');
<% end -%>

<% if @while_page_edit -%>

  Alchemy.reloadPreview();
  document.querySelector('#page_<%= @page.id %>_status').outerHTML = '<%= j render("current_page", current_page: @page) %>';
  Alchemy.growl("<%= j @notice %>");
  Alchemy.closeCurrentDialog();

<% else -%>

  if (page) {
    var page_html = "<%= j render('page', page: @page) %>";
    var compiler = Handlebars.compile(page_html);
    var tree = <%== @tree.to_json %>;
    page.outerHTML = compiler(tree.pages[0]);
    Alchemy.growl("<%= j @notice %>");
    Alchemy.closeCurrentDialog();
  } else {
    document.addEventListener('turbolinks:load', function () {
      Alchemy.growl("<%= j @notice %>");
    }, { once: true })
    Alchemy.closeCurrentDialog(function() {
      Turbolinks.visit(location.toString(), { action: "replace" });
    });
  }

<% end -%>
})()

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
alchemy_cms-5.2.7 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.2.6 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.1.10 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.rc5 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.rc4 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.rc3 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.2.5 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.1.9 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.2.4 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.1.8 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.1.7 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.2.3 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.rc2 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.1.6 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.2.2 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-5.1.5 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.rc1 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.b6 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.b5 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.b4 app/views/alchemy/admin/pages/update.js.erb