diff --git a/assets/javascripts/lib/util.coffee b/assets/javascripts/lib/util.coffee index 06e3d1cb..dae644c3 100644 --- a/assets/javascripts/lib/util.coffee +++ b/assets/javascripts/lib/util.coffee @@ -336,9 +336,6 @@ $.popup = (value) -> window.open value.href or value, '_blank' return -$.isTouchScreen = -> - typeof ontouchstart isnt 'undefined' - $.isWindows = -> navigator.platform?.indexOf('Win') >= 0 diff --git a/assets/javascripts/views/layout/mobile.coffee b/assets/javascripts/views/layout/mobile.coffee index 9e134c3f..4fb70bdb 100644 --- a/assets/javascripts/views/layout/mobile.coffee +++ b/assets/javascripts/views/layout/mobile.coffee @@ -32,9 +32,7 @@ class app.views.Mobile extends app.View super init: -> - if $.isTouchScreen() - FastClick.attach @body - app.shortcuts.stop() + FastClick.attach @body $.on @body, 'click', @onClick $.on $('._home-btn'), 'click', @onClickHome diff --git a/assets/javascripts/views/search/search.coffee b/assets/javascripts/views/search/search.coffee index a37473a1..2285c017 100644 --- a/assets/javascripts/views/search/search.coffee +++ b/assets/javascripts/views/search/search.coffee @@ -41,7 +41,7 @@ class app.views.Search extends app.View return autoFocus: => - unless $.isTouchScreen() + unless app.isMobile() @input.focus() unless document.activeElement is @input return diff --git a/assets/javascripts/views/search/search_scope.coffee b/assets/javascripts/views/search/search_scope.coffee index c7a142ae..8ed5755d 100644 --- a/assets/javascripts/views/search/search_scope.coffee +++ b/assets/javascripts/views/search/search_scope.coffee @@ -95,7 +95,7 @@ class app.views.SearchScope extends app.View else if not @doc and @input.value return if event.ctrlKey or event.metaKey or event.altKey or event.shiftKey if event.which is 9 or # tab - event.which is 32 and (app.isMobile() or $.isTouchScreen()) # space + (event.which is 32 and app.isMobile()) # space @search @input.value[0...@input.selectionStart] $.stopEvent(event) if @doc return diff --git a/assets/javascripts/views/sidebar/sidebar.coffee b/assets/javascripts/views/sidebar/sidebar.coffee index 96c1f87a..81792a93 100644 --- a/assets/javascripts/views/sidebar/sidebar.coffee +++ b/assets/javascripts/views/sidebar/sidebar.coffee @@ -10,7 +10,7 @@ class app.views.Sidebar extends app.View escape: 'onEscape' init: -> - @addSubview @hover = new app.views.SidebarHover @el unless app.isMobile() or $.isTouchScreen() + @addSubview @hover = new app.views.SidebarHover @el unless app.isMobile() @addSubview @search = new app.views.Search @search diff --git a/assets/stylesheets/global/_base.scss b/assets/stylesheets/global/_base.scss index 93799ce7..fce86ef5 100644 --- a/assets/stylesheets/global/_base.scss +++ b/assets/stylesheets/global/_base.scss @@ -14,6 +14,7 @@ body { color: $textColor; word-wrap: break-word; overflow-wrap: break-word; + touch-action: manipulation; -webkit-tap-highlight-color: rgba(black, 0); -webkit-touch-callout: none; -webkit-text-size-adjust: 100%;