|
@@ -88,23 +88,27 @@ class app.views.SearchScope extends app.View
|
|
|
@trigger 'change', null, previousDoc
|
|
@trigger 'change', null, previousDoc
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
|
|
+ doScopeSearch: (event) =>
|
|
|
|
|
+ @search @input.value[0...@input.selectionStart]
|
|
|
|
|
+ $.stopEvent(event) if @doc
|
|
|
|
|
+ return
|
|
|
|
|
+
|
|
|
onKeydown: (event) =>
|
|
onKeydown: (event) =>
|
|
|
if event.which is 8 # backspace
|
|
if event.which is 8 # backspace
|
|
|
if @doc and not @input.value
|
|
if @doc and not @input.value
|
|
|
$.stopEvent(event)
|
|
$.stopEvent(event)
|
|
|
@reset()
|
|
@reset()
|
|
|
- else if not @doc and @input.value
|
|
|
|
|
|
|
+ else if not @doc and @input.value and not $.isChromeForAndroid()
|
|
|
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()) # space
|
|
(event.which is 32 and app.isMobile()) # space
|
|
|
- @search @input.value[0...@input.selectionStart]
|
|
|
|
|
- $.stopEvent(event) if @doc
|
|
|
|
|
|
|
+ @doScopeSearch(event)
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
onTextInput: (event) =>
|
|
onTextInput: (event) =>
|
|
|
- if event.data == ' ' and app.isMobile()
|
|
|
|
|
- @search @input.value[0...@input.selectionStart]
|
|
|
|
|
- $.stopEvent(event) if @doc
|
|
|
|
|
|
|
+ return unless $.isChromeForAndroid()
|
|
|
|
|
+ if not @doc and @input.value and event.data == ' '
|
|
|
|
|
+ @doScopeSearch(event)
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
extractHashValue: ->
|
|
extractHashValue: ->
|