[DE mobile] Fix bug 44398
This commit is contained in:
parent
80237917d3
commit
1adff367de
|
@ -392,18 +392,25 @@ define([
|
||||||
initPageDocumentSettings: function () {
|
initPageDocumentSettings: function () {
|
||||||
var me = this,
|
var me = this,
|
||||||
$pageOrientation = $('.page[data-page=settings-document-view] input:radio[name=doc-orientation]'),
|
$pageOrientation = $('.page[data-page=settings-document-view] input:radio[name=doc-orientation]'),
|
||||||
$pageSize = $('#settings-document-format');
|
$pageSize = $('#settings-document-format'),
|
||||||
|
curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()),
|
||||||
|
sizeW,
|
||||||
|
sizeH;
|
||||||
|
|
||||||
// Init orientation
|
// Init orientation
|
||||||
$pageOrientation.val([_isPortrait]);
|
$pageOrientation.val([_isPortrait]);
|
||||||
$pageOrientation.single('change', _.bind(me.onOrientationChange, me));
|
$pageOrientation.single('change', _.bind(me.onOrientationChange, me));
|
||||||
|
|
||||||
// Init format
|
// Init format
|
||||||
$pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']);
|
if (_pageSizesIndex === -1) {
|
||||||
var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()),
|
$pageSize.find('.item-title').text(me.textCustomSize);
|
||||||
sizeW = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)),
|
sizeW = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizesCurrent[0]).toFixed(2));
|
||||||
|
sizeH = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizesCurrent[1]).toFixed(2));
|
||||||
|
} else {
|
||||||
|
$pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']);
|
||||||
|
sizeW = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2));
|
||||||
sizeH = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2));
|
sizeH = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2));
|
||||||
|
}
|
||||||
var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName;
|
var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName;
|
||||||
$pageSize.find('.item-subtitle').text(pageSizeTxt);
|
$pageSize.find('.item-subtitle').text(pageSizeTxt);
|
||||||
},
|
},
|
||||||
|
@ -745,12 +752,16 @@ define([
|
||||||
if (Math.abs(_pageSizesCurrent[0] - w) > 0.1 ||
|
if (Math.abs(_pageSizesCurrent[0] - w) > 0.1 ||
|
||||||
Math.abs(_pageSizesCurrent[1] - h) > 0.1) {
|
Math.abs(_pageSizesCurrent[1] - h) > 0.1) {
|
||||||
_pageSizesCurrent = [w, h];
|
_pageSizesCurrent = [w, h];
|
||||||
|
var ind = -1;
|
||||||
_.find(_pageSizes, function(size, index) {
|
_.find(_pageSizes, function(size, index) {
|
||||||
if (Math.abs(size.value[0] - w) < 0.1 && Math.abs(size.value[1] - h) < 0.1) {
|
if (Math.abs(size.value[0] - w) < 0.1 && Math.abs(size.value[1] - h) < 0.1) {
|
||||||
_pageSizesIndex = index;
|
_pageSizesIndex = index;
|
||||||
|
ind = index;
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
|
if (ind === -1) {
|
||||||
|
_pageSizesIndex = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initPageDocumentSettings();
|
this.initPageDocumentSettings();
|
||||||
|
@ -764,7 +775,8 @@ define([
|
||||||
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?'
|
warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?',
|
||||||
|
textCustomSize : 'Custom Size'
|
||||||
}
|
}
|
||||||
})(), DE.Controllers.Settings || {}))
|
})(), DE.Controllers.Settings || {}))
|
||||||
});
|
});
|
|
@ -257,6 +257,7 @@
|
||||||
"DE.Controllers.Settings.unknownText": "Unknown",
|
"DE.Controllers.Settings.unknownText": "Unknown",
|
||||||
"DE.Controllers.Settings.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
|
"DE.Controllers.Settings.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
|
||||||
"DE.Controllers.Settings.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.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.textCustomSize": "Custom Size",
|
||||||
"DE.Controllers.Toolbar.dlgLeaveMsgText": "You have unsaved changes in this document. Click 'Stay on this Page' to await the autosave of the document. Click 'Leave this Page' to discard all the unsaved changes.",
|
"DE.Controllers.Toolbar.dlgLeaveMsgText": "You have unsaved changes in this document. Click 'Stay on this Page' to await the autosave of the document. Click 'Leave this Page' to discard all the unsaved changes.",
|
||||||
"DE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application",
|
"DE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application",
|
||||||
"DE.Controllers.Toolbar.leaveButtonText": "Leave this Page",
|
"DE.Controllers.Toolbar.leaveButtonText": "Leave this Page",
|
||||||
|
|
Loading…
Reference in a new issue