[DE PE SSE mobile] Fix Bug 50796
This commit is contained in:
parent
80bbdf2828
commit
210e8dcd3b
|
@ -4,6 +4,7 @@ import { SearchController, SearchView, SearchSettingsView } from '../../../../co
|
|||
import { f7 } from 'framework7-react';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
import { Device } from '../../../../common/mobile/utils/device';
|
||||
import { observer, inject } from "mobx-react";
|
||||
|
||||
class SearchSettings extends SearchSettingsView {
|
||||
constructor(props) {
|
||||
|
@ -22,6 +23,8 @@ class SearchSettings extends SearchSettingsView {
|
|||
const show_popover = !Device.phone;
|
||||
const { t } = this.props;
|
||||
const _t = t("Settings", {returnObjects: true});
|
||||
const storeAppOptions = this.props.storeAppOptions;
|
||||
const isEdit = storeAppOptions.isEdit;
|
||||
|
||||
const markup = (
|
||||
<Page>
|
||||
|
@ -34,9 +37,14 @@ class SearchSettings extends SearchSettingsView {
|
|||
</Navbar>
|
||||
<List>
|
||||
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} />
|
||||
{isEdit ?
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace}
|
||||
onClick={e => this.onFindReplaceClick('replace')} />
|
||||
: null}
|
||||
{isEdit ?
|
||||
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
|
||||
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
|
||||
: null}
|
||||
</List>
|
||||
<List>
|
||||
<ListItem title={_t.textCaseSensitive}>
|
||||
|
@ -115,6 +123,6 @@ const Search = withTranslation()(props => {
|
|||
return <DESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} />
|
||||
});
|
||||
|
||||
const SearchSettingsWithTranslation = withTranslation()(SearchSettings);
|
||||
const SearchSettingsWithTranslation = inject("storeAppOptions")(observer(withTranslation()(SearchSettings)));
|
||||
|
||||
export {Search, SearchSettingsWithTranslation as SearchSettings}
|
||||
|
|
|
@ -4,6 +4,7 @@ import { SearchController, SearchView, SearchSettingsView } from '../../../../co
|
|||
import { f7 } from 'framework7-react';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
import { Device } from '../../../../common/mobile/utils/device';
|
||||
import { observer, inject } from "mobx-react";
|
||||
|
||||
class SearchSettings extends SearchSettingsView {
|
||||
constructor(props) {
|
||||
|
@ -15,6 +16,8 @@ class SearchSettings extends SearchSettingsView {
|
|||
const show_popover = !Device.phone;
|
||||
const { t } = this.props;
|
||||
const _t = t("View.Settings", {returnObjects: true});
|
||||
const storeAppOptions = this.props.storeAppOptions;
|
||||
const isEdit = storeAppOptions.isEdit;
|
||||
|
||||
const markup = (
|
||||
<Page>
|
||||
|
@ -27,9 +30,14 @@ class SearchSettings extends SearchSettingsView {
|
|||
</Navbar>
|
||||
<List>
|
||||
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} />
|
||||
{isEdit ?
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace}
|
||||
onClick={e => this.onFindReplaceClick('replace')} />
|
||||
: null}
|
||||
{isEdit ?
|
||||
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
|
||||
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
|
||||
: null}
|
||||
</List>
|
||||
<List>
|
||||
<ListItem title={_t.textCaseSensitive}>
|
||||
|
@ -97,6 +105,6 @@ const Search = withTranslation()(props => {
|
|||
return <PESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} />
|
||||
});
|
||||
|
||||
const SearchSettingsWithTranslation = withTranslation()(SearchSettings);
|
||||
const SearchSettingsWithTranslation = inject("storeAppOptions")(observer(withTranslation()(SearchSettings)));
|
||||
|
||||
export {Search, SearchSettingsWithTranslation as SearchSettings}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import React, {Component, useEffect} from 'react';
|
||||
import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,ListItem,List} from 'framework7-react';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {f7} from 'framework7-react';
|
||||
import {Device} from '../../../../../common/mobile/utils/device';
|
||||
import { observer, inject } from "mobx-react";
|
||||
import ApplicationSettingsController from "../../controller/settings/ApplicationSettings";
|
||||
import { MacrosSettings } from "./ApplicationSettings";
|
||||
import DownloadController from "../../controller/settings/Download";
|
||||
|
@ -56,8 +57,8 @@ const routes = [
|
|||
];
|
||||
|
||||
|
||||
const SettingsList = withTranslation()(props => {
|
||||
const {t} = props;
|
||||
const SettingsList = inject("storeAppOptions")(observer(props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Settings', {returnObjects: true});
|
||||
const navbar = <Navbar title={_t.textSettings}>
|
||||
{!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>}
|
||||
|
@ -107,13 +108,20 @@ const SettingsList = withTranslation()(props => {
|
|||
window.open(url, "_blank");
|
||||
};
|
||||
|
||||
const appOptions = props.storeAppOptions;
|
||||
let _isEdit = false;
|
||||
|
||||
if (!appOptions.isDisconnected) {
|
||||
_isEdit = appOptions.isEdit;
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={props.style} stackPages={true} routes={routes}>
|
||||
<Page>
|
||||
{navbar}
|
||||
<List>
|
||||
{!props.inPopover &&
|
||||
<ListItem title={_t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'>
|
||||
<ListItem disabled={appOptions.readerMode ? true : false} title={!_isEdit ? _t.textFind : _t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'>
|
||||
<Icon slot="media" icon="icon-search"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
|
@ -147,7 +155,7 @@ const SettingsList = withTranslation()(props => {
|
|||
</Page>
|
||||
</View>
|
||||
)
|
||||
});
|
||||
}));
|
||||
|
||||
class SettingsView extends Component {
|
||||
constructor(props) {
|
||||
|
|
|
@ -5,6 +5,7 @@ import { f7 } from 'framework7-react';
|
|||
import { withTranslation } from 'react-i18next';
|
||||
import { Dom7 } from 'framework7';
|
||||
import { Device } from '../../../../common/mobile/utils/device';
|
||||
import { observer, inject } from "mobx-react";
|
||||
|
||||
class SearchSettings extends SearchSettingsView {
|
||||
constructor(props) {
|
||||
|
@ -23,6 +24,8 @@ class SearchSettings extends SearchSettingsView {
|
|||
const show_popover = !Device.phone;
|
||||
const { t } = this.props;
|
||||
const _t = t("View.Settings", { returnObjects: true });
|
||||
const storeAppOptions = this.props.storeAppOptions;
|
||||
const isEdit = storeAppOptions.isEdit;
|
||||
|
||||
const markup = (
|
||||
<Page>
|
||||
|
@ -35,9 +38,14 @@ class SearchSettings extends SearchSettingsView {
|
|||
</Navbar>
|
||||
<List>
|
||||
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} />
|
||||
{isEdit ?
|
||||
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace}
|
||||
onClick={e => this.onFindReplaceClick('replace')} />
|
||||
: null}
|
||||
{isEdit ?
|
||||
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
|
||||
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
|
||||
: null}
|
||||
</List>
|
||||
<BlockTitle>{_t.textSearchIn}</BlockTitle>
|
||||
<List>
|
||||
|
@ -206,6 +214,6 @@ const Search = withTranslation()(props => {
|
|||
return <SESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} />
|
||||
});
|
||||
|
||||
const SearchSettingsWithTranslation = withTranslation()(SearchSettings);
|
||||
const SearchSettingsWithTranslation = inject("storeAppOptions")(observer(withTranslation()(SearchSettings)));
|
||||
|
||||
export {Search, SearchSettingsWithTranslation as SearchSettings}
|
|
@ -195,12 +195,13 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
|
|||
|
||||
if (index == api.asc_getActiveWorksheetIndex()) {
|
||||
if (!opened) {
|
||||
if (!isDisconnected) {
|
||||
if (isEdit && !isDisconnected) {
|
||||
api.asc_closeCellEditor();
|
||||
f7.popover.open('#idx-tab-context-menu-popover', target);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
f7.popover.close('#idx-tab-context-menu-popover', false);
|
||||
onTabClicked(i);
|
||||
// Common.Notifications.trigger('sheet:active', index);
|
||||
|
|
|
@ -8,12 +8,13 @@ const viewStyle = {
|
|||
height: 30
|
||||
};
|
||||
|
||||
const StatusbarView = inject('sheets')(observer(props => {
|
||||
const StatusbarView = inject('sheets', "storeAppOptions")(observer(props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('Statusbar', {returnObjects: true});
|
||||
const isAndroid = Device.android;
|
||||
const isPhone = Device.isPhone;
|
||||
const { sheets } = props;
|
||||
const { sheets, storeAppOptions } = props;
|
||||
const isEdit = storeAppOptions.isEdit;
|
||||
const hiddenSheets = sheets.hiddenWorksheets();
|
||||
const allSheets = sheets.sheets;
|
||||
const getTabClassList = model => `tab ${model.active ? 'active' : ''} ${model.locked ? 'locked' : ''}`;
|
||||
|
@ -134,6 +135,7 @@ const StatusbarView = inject('sheets')(observer(props => {
|
|||
</ul>
|
||||
</div>
|
||||
</View>
|
||||
{isEdit ?
|
||||
<Popover id="idx-tab-context-menu-popover"
|
||||
className="document-menu"
|
||||
backdrop={false}
|
||||
|
@ -158,6 +160,7 @@ const StatusbarView = inject('sheets')(observer(props => {
|
|||
</List>
|
||||
)}
|
||||
</Popover>
|
||||
: null}
|
||||
{isPhone || isAndroid ? (
|
||||
<Actions id="idx-tab-menu-actions" backdrop={true} closeByBackdropClick={true}>
|
||||
<ActionsGroup>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import React, {Component, useEffect} from 'react';
|
||||
import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,ListItem,List} from 'framework7-react';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {f7} from 'framework7-react';
|
||||
import {Device} from '../../../../../common/mobile/utils/device';
|
||||
import { observer, inject } from "mobx-react";
|
||||
import SpreadsheetSettingsController from '../../controller/settings/SpreadsheetSettings.jsx';
|
||||
import ApplicationSettingsController from '../../controller/settings/ApplicationSettings.jsx';
|
||||
import SpreadsheetInfoController from '../../controller/settings/SpreadsheetInfo.jsx';
|
||||
|
@ -64,8 +65,8 @@ const routes = [
|
|||
];
|
||||
|
||||
|
||||
const SettingsList = withTranslation()(props => {
|
||||
const {t} = props;
|
||||
const SettingsList = inject("storeAppOptions")(observer(props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Settings', {returnObjects: true});
|
||||
const navbar = <Navbar title={_t.textSettings}>
|
||||
{!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>}
|
||||
|
@ -115,6 +116,12 @@ const SettingsList = withTranslation()(props => {
|
|||
window.open(url, "_blank");
|
||||
};
|
||||
|
||||
const appOptions = props.storeAppOptions;
|
||||
let _isEdit = false;
|
||||
|
||||
if (!appOptions.isDisconnected) {
|
||||
_isEdit = appOptions.isEdit;
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={props.style} stackPages={true} routes={routes}>
|
||||
|
@ -122,7 +129,7 @@ const SettingsList = withTranslation()(props => {
|
|||
{navbar}
|
||||
<List>
|
||||
{!props.inPopover &&
|
||||
<ListItem title={_t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'>
|
||||
<ListItem disabled={appOptions.readerMode ? true : false} title={!_isEdit ? _t.textFind : _t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'>
|
||||
<Icon slot="media" icon="icon-search"></Icon>
|
||||
</ListItem>
|
||||
}
|
||||
|
@ -156,7 +163,7 @@ const SettingsList = withTranslation()(props => {
|
|||
</Page>
|
||||
</View>
|
||||
)
|
||||
});
|
||||
}));
|
||||
|
||||
class SettingsView extends Component {
|
||||
constructor(props) {
|
||||
|
|
Loading…
Reference in a new issue