[mobile] Fix display "Choose TXT/CSV Options" (Download As)

This commit is contained in:
Julia Svinareva 2019-07-30 17:14:25 +03:00
parent 4e2f5fdaee
commit 00a1842f85
4 changed files with 80 additions and 61 deletions

View file

@ -1132,18 +1132,16 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
me._state.openDlg = uiApp.modal({ var buttons = [];
title: me.advTxtOptions, if (mode === 2) {
text: '', buttons.push({
afterText: text: me.textCancel,
'<div class="content-block">' + onClick: function () {
'<div class="row">' + me._state.openDlg = null;
'<div class="col-100">Encoding</div>' + }
'</div>' + });
'<div id="txt-encoding"></div>' + }
'</div>', buttons.push({
buttons: [
{
text: 'OK', text: 'OK',
bold: true, bold: true,
onClick: function() { onClick: function() {
@ -1163,8 +1161,19 @@ define([
} }
me._state.openDlg = null; me._state.openDlg = null;
} }
} });
]
me._state.openDlg = uiApp.modal({
title: me.advTxtOptions,
text: '',
afterText:
'<div class="content-block">' +
'<div class="row">' +
'<div class="col-100">Encoding</div>' +
'</div>' +
'<div id="txt-encoding"></div>' +
'</div>',
buttons: buttons
}); });
picker = uiApp.picker({ picker = uiApp.picker({

View file

@ -564,7 +564,7 @@ define([
if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) { if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) {
_.defer(function () { _.defer(function () {
uiApp.confirm( uiApp.confirm(
me.warnDownloadAs, (format === Asc.c_oAscFileType.TXT) ? me.warnDownloadAs : me.warnDownloadAsRTF,
me.notcriticalErrorTitle, me.notcriticalErrorTitle,
function () { function () {
Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format));
@ -746,7 +746,8 @@ define([
unknownText: 'Unknown', unknownText: 'Unknown',
txtLoading : 'Loading...', txtLoading : 'Loading...',
notcriticalErrorTitle : 'Warning', notcriticalErrorTitle : 'Warning',
warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?' warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?',
warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?'
} }
})(), DE.Controllers.Settings || {})) })(), DE.Controllers.Settings || {}))
}); });

View file

@ -519,6 +519,18 @@
</div> </div>
</a> </a>
</li> </li>
<li>
<a data-format="68" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-rtf"></i>
</div>
<div class="item-inner">
<div class="item-title">RTF</div>
</div>
</div>
</a>
</li>
<li> <li>
<a data-format="67" class="item-link no-indicator"> <a data-format="67" class="item-link no-indicator">
<div class="item-content"> <div class="item-content">
@ -567,18 +579,6 @@
</div> </div>
</a> </a>
</li> </li>
<li>
<a data-format="68" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-format-rtf"></i>
</div>
<div class="item-inner">
<div class="item-title">RTF</div>
</div>
</div>
</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>

View file

@ -1232,19 +1232,16 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
me._state.openDlg = uiApp.modal({ var buttons = [];
title: me.advCSVOptions, if (mode === 2) {
text: '', buttons.push({
afterText: text: me.textCancel,
'<div class="content-block small-picker" style="padding: 0; margin: 20px 0 0;">' + onClick: function () {
'<div class="row">' + me._state.openDlg = null;
'<div class="col-50" style="text-align: left;">' + me.txtEncoding + '</div>' + }
'<div class="col-50" style="text-align: right;">' + me.txtDelimiter + '</div>' + });
'</div>' + }
'<div id="txt-encoding" class="small"></div>' + buttons.push({
'</div>',
buttons: [
{
text: 'OK', text: 'OK',
bold: true, bold: true,
onClick: function() { onClick: function() {
@ -1253,7 +1250,7 @@ define([
if (me.api) { if (me.api) {
if (mode==2) { if (mode==2) {
formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(encoding)); formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTextOptions(encoding, delimiter));
me.api.asc_DownloadAs(formatOptions); me.api.asc_DownloadAs(formatOptions);
} else { } else {
me.api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(encoding, delimiter)); me.api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(encoding, delimiter));
@ -1265,8 +1262,20 @@ define([
} }
me._state.openDlg = null; me._state.openDlg = null;
} }
} });
]
me._state.openDlg = uiApp.modal({
title: me.advCSVOptions,
text: '',
afterText:
'<div class="content-block small-picker" style="padding: 0; margin: 20px 0 0;">' +
'<div class="row">' +
'<div class="col-50" style="text-align: left;">' + me.txtEncoding + '</div>' +
'<div class="col-50" style="text-align: right;">' + me.txtDelimiter + '</div>' +
'</div>' +
'<div id="txt-encoding" class="small"></div>' +
'</div>',
buttons: buttons
}); });
var recommendedSettings = advOptions.asc_getRecommendedSettings(); var recommendedSettings = advOptions.asc_getRecommendedSettings();