Remove browser gem direct dependency
While the browser gem is great, we don't need it in this case for such a simple usage. There are a few really small differences between this code and the old one: matching `/MSIE/` will return true for Opera 12 and false for certain versions of IE11. Since we're only rendering a comment for IE8 and below, we don't care about IE11, and Opera 12 is six years old and its users won't be affected by the comment. Note we're still using the browser gem because ahoy_matey depends on it, but now it's an indirect dependency.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<div class="wrapper <%= yield (:wrapper_class) %>">
|
||||
<%= render "layouts/header", with_subnavigation: true %>
|
||||
|
||||
<% if browser.ie? && cookies["ie_alert_closed"] != "true" %>
|
||||
<% if request.headers["User-Agent"] =~ /MSIE/ && cookies["ie_alert_closed"] != "true" %>
|
||||
<!--[if lt IE 9]>
|
||||
<div data-alert class="callout primary ie-callout" data-closable>
|
||||
<button class="close-button ie-callout-close-js"
|
||||
|
||||
Reference in New Issue
Block a user