[openstreetmap/openstreetmap-website] Reverse welcome banner show/hide logic (#1990)

Tom Hughes notifications at github.com
Mon Sep 10 19:42:44 UTC 2018


tomhughes commented on this pull request.



> @@ -187,8 +187,10 @@ $(document).ready(function () {
     $.cookie('_osm_location', OSM.locationCookie(map), { expires: expiry, path: '/' });
   });
 
-  if ($.cookie('_osm_welcome') === 'hide') {
-    $('.welcome').hide();
+  if ($.cookie('_osm_welcome') !== 'hide' &&
+     (typeof window.matchMedia !== "function" ||
+     !window.matchMedia("only screen and (max-width:768px)").matches)) {

This doesn't appear to have anything to do with resolving #1951 so perhaps you could explain what it's about?

How widely supported is that function? I mean I can see you're concerned it might not exist so it's obviously not universal - checking it's type is probably overkill in any case unless we're expecting somebody to create `window.matchmedia` with some other type to annoy us!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1990#pullrequestreview-153932001
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180910/0538bf3d/attachment.html>


More information about the rails-dev mailing list