binds the ie alert close link to a cookie that will be checked before showing the alert the next time

This commit is contained in:
David Gil
2015-09-18 01:25:55 +02:00
parent 61f1dfe2e8
commit e8f1d627b1
4 changed files with 13 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ var initialize_modules = function() {
App.LocationChanger.initialize(); App.LocationChanger.initialize();
App.CheckAllNone.initialize(); App.CheckAllNone.initialize();
App.PreventDoubleSubmission.initialize(); App.PreventDoubleSubmission.initialize();
App.IeAlert.initialize();
}; };
$(function(){ $(function(){

View File

@@ -1,4 +1,4 @@
App.Dropdown = App.Dropdown =
initialize: -> initialize: ->
$(document).foundation(); $(document).foundation()

View File

@@ -0,0 +1,9 @@
App.IeAlert =
set_cookie_and_hide: (event) ->
event.preventDefault()
$.cookie('ie_alert_closed', 'true', { path: '/', expires: 365 });
$('.ie-alert-box').remove()
initialize: ->
$('.ie-alert-box-close-js').on 'click', (event) ->
App.IeAlert.set_cookie_and_hide(event)

View File

@@ -23,9 +23,9 @@
<%= render 'layouts/header' %> <%= render 'layouts/header' %>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<% if browser.ie? %> <% if browser.ie? && cookies['ie_alert_closed'] != 'true' %>
<div data-alert class="alert-box info ie-alert-box"> <div data-alert class="alert-box info ie-alert-box">
<a href="#" class="close">&times;</a> <a href="#" class="close ie-alert-box-close-js">&times;</a>
<h2><%= t("layouts.application.ie_title") %></h2> <h2><%= t("layouts.application.ie_title") %></h2>
<p> <p>
<%= t("layouts.application.ie", <%= t("layouts.application.ie",