[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._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: [
{
var buttons = [];
if (mode === 2) {
buttons.push({
text: me.textCancel,
onClick: function () {
me._state.openDlg = null;
}
});
}
buttons.push({
text: 'OK',
bold: true,
onClick: function() {
@ -1163,8 +1161,19 @@ define([
}
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({

View file

@ -564,7 +564,7 @@ define([
if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) {
_.defer(function () {
uiApp.confirm(
me.warnDownloadAs,
(format === Asc.c_oAscFileType.TXT) ? me.warnDownloadAs : me.warnDownloadAsRTF,
me.notcriticalErrorTitle,
function () {
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',
txtLoading : 'Loading...',
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 || {}))
});

View file

@ -519,6 +519,18 @@
</div>
</a>
</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>
<a data-format="67" class="item-link no-indicator">
<div class="item-content">
@ -567,18 +579,6 @@
</div>
</a>
</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>
</div>
</div>

View file

@ -1232,19 +1232,16 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument);
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: [
{
var buttons = [];
if (mode === 2) {
buttons.push({
text: me.textCancel,
onClick: function () {
me._state.openDlg = null;
}
});
}
buttons.push({
text: 'OK',
bold: true,
onClick: function() {
@ -1253,7 +1250,7 @@ define([
if (me.api) {
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);
} else {
me.api.asc_setAdvancedOptions(type, new Asc.asc_CTextOptions(encoding, delimiter));
@ -1265,8 +1262,20 @@ define([
}
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();