Sha256: fcfde4c15b744c8d2a72f2f7381661fb1d5ba1fe0c96ebd3825481cf79011a45

Contents?: true

Size: 598 Bytes

Versions: 6

Compression:

Stored size: 598 Bytes

Contents

<% content_for :javascript do %>
<script type="text/javascript">
  var eventName = typeof(Turbolinks) !== 'undefined' ? 'turbolinks:load' : 'DOMContentLoaded';

  if (!document.documentElement.hasAttribute("data-turbolinks-preview")) {
    document.addEventListener(eventName, function flash() {
      <% if flash[:notice] %>
        SpiffyApp.flashNotice(<%== flash[:notice].to_json %>);
      <% end %>

      <% if flash[:error] %>
        SpiffyApp.flashError(<%== flash[:error].to_json %>);
      <% end %>

      document.removeEventListener(eventName, flash)
    });
  }
</script>
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spiffy_stores_app-8.2.11 lib/generators/spiffy_stores_app/install/templates/_flash_messages.html.erb
spiffy_stores_app-8.2.10 lib/generators/spiffy_stores_app/install/templates/_flash_messages.html.erb
spiffy_stores_app-8.2.9 lib/generators/spiffy_stores_app/install/templates/_flash_messages.html.erb
spiffy_stores_app-8.2.8 lib/generators/spiffy_stores_app/install/templates/_flash_messages.html.erb
spiffy_stores_app-8.2.7 lib/generators/spiffy_stores_app/install/templates/_flash_messages.html.erb
spiffy_stores_app-8.2.6 lib/generators/spiffy_stores_app/install/templates/_flash_messages.html.erb