[DE mobile] Correct imports f7 and searchbar

This commit is contained in:
SergeyEzhin 2022-10-20 12:46:24 +04:00
parent 3bfca10bcd
commit a067234b87
3 changed files with 7 additions and 18 deletions

View file

@ -1,13 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Popover, Popup, View, Page, List, ListItem, Navbar, NavRight, Link, f7 } from 'framework7-react'; import { Popover, Popup, View, f7 } from 'framework7-react';
import { Toggle } from 'framework7-react';
// import { f7 } from 'framework7-react/shared/f7.js';
// import { Dom7 } from 'framework7';
import { Device } from '../../../../common/mobile/utils/device'; import { Device } from '../../../../common/mobile/utils/device';
import { observable, runInAction } from "mobx"; import { observable, runInAction } from "mobx";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import Searchbar from 'framework7/components/searchbar'
const searchOptions = observable({ const searchOptions = observable({
usereplace: false, usereplace: false,
@ -106,13 +102,8 @@ class SearchView extends Component {
$editor.on('pointerdown', this.onEditorTouchStart); $editor.on('pointerdown', this.onEditorTouchStart);
$editor.on('pointerup', this.onEditorTouchEnd); $editor.on('pointerup', this.onEditorTouchEnd);
// if(!this.searchbar) {
// // f7.searchbar.get('.searchbar');
// // this.searchbar = Searchbar.get('.searchbar');
// }
if(!this.searchbar) { if(!this.searchbar) {
this.searchbar = Searchbar.create({ this.searchbar = f7.searchbar.create({
el: '.searchbar', el: '.searchbar',
customSearch: true, customSearch: true,
expandable: true, expandable: true,

View file

@ -3,9 +3,8 @@ import React, { Suspense } from 'react';
import { createRoot } from 'react-dom/client'; import { createRoot } from 'react-dom/client';
// Import Framework7 // Import Framework7
// framework7/lite-bundle import Framework7 from 'framework7/lite-bundle';
import Framework7 from 'framework7/lite'; import { Dom7 } from 'framework7/lite-bundle';
import { Dom7 } from 'framework7/lite';
window.$$ = Dom7; window.$$ = Dom7;
// Import Framework7-React Plugin // Import Framework7-React Plugin

View file

@ -4,7 +4,6 @@ import { SearchController, SearchView, SearchSettingsView } from '../../../../co
import { withTranslation } from 'react-i18next'; import { withTranslation } from 'react-i18next';
import { Device } from '../../../../common/mobile/utils/device'; import { Device } from '../../../../common/mobile/utils/device';
import { observer, inject } from "mobx-react"; import { observer, inject } from "mobx-react";
// import { f7 } from 'framework7-react/shared/f7.js';
class SearchSettings extends SearchSettingsView { class SearchSettings extends SearchSettingsView {
constructor(props) { constructor(props) {
@ -94,12 +93,12 @@ class DESearchView extends SearchView {
const Search = withTranslation()(props => { const Search = withTranslation()(props => {
const { t } = props; const { t } = props;
const _t = t('Settings', {returnObjects: true}); const _t = t('Settings', {returnObjects: true});
// f7.searchbar.get('.searchbar')?.enabled &&
useEffect(() => { useEffect(() => {
if(Device.phone) { if(f7.searchbar.get('.searchbar')?.enabled && Device.phone) {
const api = Common.EditorApi.get(); const api = Common.EditorApi.get();
$$('.searchbar-input').focus(); $$('.searchbar-input').focus();
// api.asc_enableKeyEvents(false); api.asc_enableKeyEvents(false);
} }
}, []); }, []);