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:
Sam 2016-09-15 07:36:16 +10:00
parent 92e716a1fd
commit fe7883eeea
2 changed files with 16 additions and 0 deletions

View file

@ -29,6 +29,18 @@ const Mobile = {
// localStorage may be disabled, just skip this
// 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() {

View file

@ -10,7 +10,11 @@
<link rel="icon" sizes="144x144" href="<%=SiteSetting.apple_touch_icon_url%>">
<%- end %>
<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">
<% end %>
<%= canonical_link_tag %>
<%= render_sitelinks_search_tag %>
<link rel="search" type="application/opensearchdescription+xml" href="<%= Discourse.base_url %>/opensearch.xml">