Sha256: b48e2867edc1690a0c02adbbdff09bca46c9aaa1b9adfa41f060a1e125966d0c

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

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

<% 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();

<% elsif @page.parent_id != @old_parent_id -%>

  Alchemy.closeCurrentDialog(function() {
    Alchemy.growl("<%= j @notice %>");
    Alchemy.currentSitemap.load(<%= @page.get_language_root.id %>);
  });

<% 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

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-6.0.7 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.6 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.5 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.4 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.3 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.2 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.1 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-6.0.0.pre.rc7 app/views/alchemy/admin/pages/update.js.erb