mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
UX: don't allow user scaling in mobile view
on iOS 10 behavior of zoom restriction has changed. This does not disable zooming on iOS 10 but it DOES stop it from randomly zooming when you are composing
This commit is contained in:
parent
92e716a1fd
commit
fe7883eeea
2 changed files with 16 additions and 0 deletions
|
@ -29,6 +29,18 @@ const Mobile = {
|
||||||
// localStorage may be disabled, just skip this
|
// localStorage may be disabled, just skip this
|
||||||
// you get security errors if it is disabled
|
// you get security errors if it is disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sam: I tried this to disable zooming on iOS 10 but it is not consistent
|
||||||
|
// you can still sometimes trigger zoom and be stuck in a horrible state
|
||||||
|
//
|
||||||
|
// let iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
|
||||||
|
// if (iOS) {
|
||||||
|
// document.documentElement.addEventListener('touchstart', function (event) {
|
||||||
|
// if (event.touches.length > 1) {
|
||||||
|
// event.preventDefault();
|
||||||
|
// }
|
||||||
|
// }, false);
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleMobileView() {
|
toggleMobileView() {
|
||||||
|
|
|
@ -10,7 +10,11 @@
|
||||||
<link rel="icon" sizes="144x144" href="<%=SiteSetting.apple_touch_icon_url%>">
|
<link rel="icon" sizes="144x144" href="<%=SiteSetting.apple_touch_icon_url%>">
|
||||||
<%- end %>
|
<%- end %>
|
||||||
<meta name="theme-color" content="#<%= ColorScheme.hex_for_name('header_background') %>">
|
<meta name="theme-color" content="#<%= ColorScheme.hex_for_name('header_background') %>">
|
||||||
|
<% if mobile_view? %>
|
||||||
|
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<% else %>
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes">
|
||||||
|
<% end %>
|
||||||
<%= canonical_link_tag %>
|
<%= canonical_link_tag %>
|
||||||
<%= render_sitelinks_search_tag %>
|
<%= render_sitelinks_search_tag %>
|
||||||
<link rel="search" type="application/opensearchdescription+xml" href="<%= Discourse.base_url %>/opensearch.xml">
|
<link rel="search" type="application/opensearchdescription+xml" href="<%= Discourse.base_url %>/opensearch.xml">
|
||||||
|
|
Loading…
Reference in a new issue