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:
@@ -34,6 +34,7 @@ var initialize_modules = function() {
|
||||
App.LocationChanger.initialize();
|
||||
App.CheckAllNone.initialize();
|
||||
App.PreventDoubleSubmission.initialize();
|
||||
App.IeAlert.initialize();
|
||||
};
|
||||
|
||||
$(function(){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
App.Dropdown =
|
||||
|
||||
initialize: ->
|
||||
$(document).foundation();
|
||||
$(document).foundation()
|
||||
|
||||
9
app/assets/javascripts/ie_alert.js.coffee
Normal file
9
app/assets/javascripts/ie_alert.js.coffee
Normal 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)
|
||||
@@ -23,9 +23,9 @@
|
||||
<%= render 'layouts/header' %>
|
||||
|
||||
<!--[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">
|
||||
<a href="#" class="close">×</a>
|
||||
<a href="#" class="close ie-alert-box-close-js">×</a>
|
||||
<h2><%= t("layouts.application.ie_title") %></h2>
|
||||
<p>
|
||||
<%= t("layouts.application.ie",
|
||||
|
||||
Reference in New Issue
Block a user