@1ec5 commented on this pull request.
This is another subtle difference between Special:Redirect and the MediaWiki
API, which is why the initial request for the item details doesn’t run into
this problem.
> @@ -171,8 +171,8 @@
.addClass("bg-body-tertiary");
if (icon && OSM.WIKIMEDIA_COMMONS_URL) {
- let src = OSM.WIKIMEDIA_COMMONS_URL + "Special:Redirect/file/" +
encodeURIComponent(icon);
- if (!icon.endsWith(".svg")) src += "?width=128";
+ let src = OSM.WIKIMEDIA_COMMONS_URL + "Special:Redirect/file/" +
encodeURIComponent(icon) + "?mobileaction=toggle_view_desktop";
In cursory testing, this doesn’t cause subsequent user-initiated page loads on
Commons to switch back to desktop view, which is good. Still a bit
counterintuitive in this code, so a comment explaining the parameter would be a
good idea.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6202#pullrequestreview-3031368828
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6202/review/3031368...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev