From d899bcabbf2d2a47718a6b7d0cffbe869e9bb444 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Fri, 15 Oct 2021 15:22:07 +0400 Subject: [PATCH] [common] Correct searchbar --- apps/common/mobile/lib/view/Search.jsx | 62 +++++++++++++------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/apps/common/mobile/lib/view/Search.jsx b/apps/common/mobile/lib/view/Search.jsx index 6860c45cf..2bf447733 100644 --- a/apps/common/mobile/lib/view/Search.jsx +++ b/apps/common/mobile/lib/view/Search.jsx @@ -93,41 +93,39 @@ class SearchView extends Component { const $$ = Dom7; $$(document).on('page:init', (e, page) => { - if ( page.name == 'home' ) { - this.searchbar = f7.searchbar.create({ - el: '.searchbar', - customSearch: true, - expandable: true, - backdrop: false, - on: { - search: (bar, curval, prevval) => { - }, - enable: this.onSearchbarShow.bind(this, true), - disable: this.onSearchbarShow.bind(this, false) - } - }); - - // function iOSVersion() { - // var ua = navigator.userAgent; - // var m; - // return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0; - // } - - const $editor = $$('#editor_sdk'); - // const $replaceLink = $$('#replace-link'); - - if (false /* iOSVersion < 13 */) { - // $editor.on('mousedown touchstart', this.onEditorTouchStart.bind(this)); - // $editor.on('mouseup touchend', this.onEditorTouchEnd.bind(this)); - } else { - // $editor.on('pointerdown', this.onEditorTouchStart.bind(this)); - // $editor.on('pointerup', this.onEditorTouchEnd.bind(this)); + this.searchbar = f7.searchbar.create({ + el: '.searchbar', + customSearch: true, + expandable: true, + backdrop: false, + on: { + search: (bar, curval, prevval) => { + }, + enable: this.onSearchbarShow.bind(this, true), + disable: this.onSearchbarShow.bind(this, false) } + }); - $editor.on('pointerdown', this.onEditorTouchStart.bind(this)); - $editor.on('pointerup', this.onEditorTouchEnd.bind(this)); - // $replaceLink.on('click', this.onReplaceHold.bind(this)); + // function iOSVersion() { + // var ua = navigator.userAgent; + // var m; + // return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0; + // } + + const $editor = $$('#editor_sdk'); + // const $replaceLink = $$('#replace-link'); + + if (false /* iOSVersion < 13 */) { + // $editor.on('mousedown touchstart', this.onEditorTouchStart.bind(this)); + // $editor.on('mouseup touchend', this.onEditorTouchEnd.bind(this)); + } else { + // $editor.on('pointerdown', this.onEditorTouchStart.bind(this)); + // $editor.on('pointerup', this.onEditorTouchEnd.bind(this)); } + + $editor.on('pointerdown', this.onEditorTouchStart.bind(this)); + $editor.on('pointerup', this.onEditorTouchEnd.bind(this)); + // $replaceLink.on('click', this.onReplaceHold.bind(this)); }); this.onSettingsClick = this.onSettingsClick.bind(this);