[SSE mobile] Correct Encoding
This commit is contained in:
parent
1b5397d222
commit
5a30ae5cc9
|
@ -25,7 +25,7 @@ export class storeEncoding {
|
|||
}
|
||||
|
||||
type;
|
||||
mode;
|
||||
mode = 1;
|
||||
pages = [];
|
||||
pagesName = [];
|
||||
advOptions;
|
||||
|
|
|
@ -55,12 +55,14 @@ const onAdvancedOptions = (type, advOptions, mode, formatOptions, _t, isDocReady
|
|||
|
||||
storeEncoding.initOptions({type, advOptions, formatOptions});
|
||||
storeEncoding.initPages();
|
||||
storeEncoding.initNamesDelimeter([_t.txtComma, _t.txtSemicolon, _t.txtColon, _t.txtTab, _t.txtSpace]);
|
||||
storeEncoding.setMode(mode);
|
||||
storeEncoding.initNamesDelimeter([_t.txtComma, _t.txtSemicolon, _t.txtColon, _t.txtTab, _t.txtSpace]);
|
||||
storeEncoding.changeEncoding(recommendedSettings.asc_getCodePage());
|
||||
storeEncoding.changeDelimeter(recommendedSettings && recommendedSettings.asc_getDelimiter() ? recommendedSettings.asc_getDelimiter() : 4);
|
||||
|
||||
f7.views.current.router.navigate('/encoding/');
|
||||
if(mode === 2) {
|
||||
f7.views.current.router.navigate('/encoding/');
|
||||
}
|
||||
}
|
||||
// let picker;
|
||||
// const pages = [];
|
||||
|
|
|
@ -12,7 +12,7 @@ class EncodingController extends Component {
|
|||
|
||||
closeModal() {
|
||||
if (Device.phone) {
|
||||
f7.sheet.close('.settings-popup', true);
|
||||
f7.sheet.close('.settings-popup', false);
|
||||
} else {
|
||||
f7.popover.close('#settings-popover');
|
||||
}
|
||||
|
@ -20,15 +20,16 @@ class EncodingController extends Component {
|
|||
|
||||
onSaveFormat(mode, valueEncoding, valueDelimeter) {
|
||||
const api = Common.EditorApi.get();
|
||||
|
||||
this.closeModal();
|
||||
const storeEncoding = this.props.storeEncoding;
|
||||
|
||||
if(mode === 2) {
|
||||
const formatOptions = this.props.storeEncoding.formatOptions;
|
||||
this.closeModal();
|
||||
const formatOptions = storeEncoding.formatOptions;
|
||||
formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
|
||||
api.asc_DownloadAs(formatOptions);
|
||||
} else {
|
||||
const type = this.props.storeEncoding.type;
|
||||
storeEncoding.setMode(1);
|
||||
const type = storeEncoding.type;
|
||||
api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(valueEncoding, valueDelimeter));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,6 +74,7 @@ class MainPage extends Component {
|
|||
const config = appOptions.config;
|
||||
const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
|
||||
const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo));
|
||||
|
||||
return (
|
||||
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>
|
||||
{/* Top Navbar */}
|
||||
|
@ -105,7 +106,7 @@ class MainPage extends Component {
|
|||
<AddOptions onclosed={this.handleOptionsViewClosed.bind(this, 'add')} showOptions={this.state.addShowOptions} />
|
||||
}
|
||||
{
|
||||
!this.state.settingsVisible ? null :
|
||||
!this.state.settingsVisible && this.props.storeEncoding.mode ? null :
|
||||
<Settings openOptions={this.handleClickToOpenOptions} onclosed={this.handleOptionsViewClosed.bind(this, 'settings')} />
|
||||
}
|
||||
{
|
||||
|
@ -124,4 +125,4 @@ class MainPage extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
export default inject("storeAppOptions")(observer(MainPage));
|
||||
export default inject("storeAppOptions", "storeEncoding")(observer(MainPage));
|
|
@ -15,7 +15,7 @@ const PageEncoding = props => {
|
|||
|
||||
return (
|
||||
<Page>
|
||||
<Navbar title={_t.textChooseCsvOptions} backLink={_t.textBack} />
|
||||
<Navbar title={_t.textChooseCsvOptions} backLink={mode === 2 ? _t.textBack : ''} />
|
||||
<BlockTitle>{_t.textDelimeter}</BlockTitle>
|
||||
<List>
|
||||
<ListItem title={nameDelimeter} href="/delimeter-list/"></ListItem>
|
||||
|
|
|
@ -79,7 +79,7 @@ const routes = [
|
|||
];
|
||||
|
||||
|
||||
const SettingsList = inject("storeAppOptions")(observer(props => {
|
||||
const SettingsList = inject("storeAppOptions", "storeEncoding")(observer(props => {
|
||||
const { t } = useTranslation();
|
||||
const _t = t('View.Settings', {returnObjects: true});
|
||||
const navbar = <Navbar title={_t.textSettings}>
|
||||
|
@ -138,7 +138,7 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
|
|||
}
|
||||
|
||||
return (
|
||||
<View style={props.style} stackPages={true} routes={routes}>
|
||||
<View style={props.style} stackPages={true} routes={routes} url={!props.storeEncoding.mode && '/encoding/'}>
|
||||
<Page>
|
||||
{navbar}
|
||||
<List>
|
||||
|
|
Loading…
Reference in a new issue