Thibaut Courouble 8 years ago
parent 7e0d60a241
commit c2c26ad576

@ -336,9 +336,6 @@ $.popup = (value) ->
window.open value.href or value, '_blank' window.open value.href or value, '_blank'
return return
$.isTouchScreen = ->
typeof ontouchstart isnt 'undefined'
$.isWindows = -> $.isWindows = ->
navigator.platform?.indexOf('Win') >= 0 navigator.platform?.indexOf('Win') >= 0

@ -32,9 +32,7 @@ class app.views.Mobile extends app.View
super super
init: -> init: ->
if $.isTouchScreen() FastClick.attach @body
FastClick.attach @body
app.shortcuts.stop()
$.on @body, 'click', @onClick $.on @body, 'click', @onClick
$.on $('._home-btn'), 'click', @onClickHome $.on $('._home-btn'), 'click', @onClickHome

@ -41,7 +41,7 @@ class app.views.Search extends app.View
return return
autoFocus: => autoFocus: =>
unless $.isTouchScreen() unless app.isMobile()
@input.focus() unless document.activeElement is @input @input.focus() unless document.activeElement is @input
return return

@ -95,7 +95,7 @@ class app.views.SearchScope extends app.View
else if not @doc and @input.value else if not @doc and @input.value
return if event.ctrlKey or event.metaKey or event.altKey or event.shiftKey return if event.ctrlKey or event.metaKey or event.altKey or event.shiftKey
if event.which is 9 or # tab 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] @search @input.value[0...@input.selectionStart]
$.stopEvent(event) if @doc $.stopEvent(event) if @doc
return return

@ -10,7 +10,7 @@ class app.views.Sidebar extends app.View
escape: 'onEscape' escape: 'onEscape'
init: -> 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 @addSubview @search = new app.views.Search
@search @search

@ -14,6 +14,7 @@ body {
color: $textColor; color: $textColor;
word-wrap: break-word; word-wrap: break-word;
overflow-wrap: break-word; overflow-wrap: break-word;
touch-action: manipulation;
-webkit-tap-highlight-color: rgba(black, 0); -webkit-tap-highlight-color: rgba(black, 0);
-webkit-touch-callout: none; -webkit-touch-callout: none;
-webkit-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;

Loading…
Cancel
Save