Fix Bug 42160

This commit is contained in:
Julia Radzhabova 2019-07-23 15:07:51 +03:00
parent f97967a60c
commit bf92472a4a
8 changed files with 29 additions and 9 deletions

View file

@ -44,7 +44,7 @@
newDocumentPage.focus();
}
}
, dialogPrint: function(url) {
, dialogPrint: function(url, api) {
$('#id-print-frame').remove();
if ( !!url ) {
@ -59,10 +59,14 @@
document.body.appendChild(iframePrint);
iframePrint.onload = function () {
iframePrint.contentWindow.focus();
iframePrint.contentWindow.print();
iframePrint.contentWindow.blur();
window.focus();
try {
iframePrint.contentWindow.focus();
iframePrint.contentWindow.print();
iframePrint.contentWindow.blur();
window.focus();
} catch (e) {
api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
}
};
iframePrint.src = url;

View file

@ -208,7 +208,7 @@ DE.ApplicationController = new(function(){
}
function onPrintUrl(url) {
common.utils.dialogPrint(url);
common.utils.dialogPrint(url, api);
}
function hidePreloader() {

View file

@ -2090,10 +2090,14 @@ define([
this.iframePrint.style.bottom = "0";
document.body.appendChild(this.iframePrint);
this.iframePrint.onload = function() {
try {
me.iframePrint.contentWindow.focus();
me.iframePrint.contentWindow.print();
me.iframePrint.contentWindow.blur();
window.focus();
} catch (e) {
me.api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
}
};
}
if (url) this.iframePrint.src = url;

View file

@ -205,7 +205,7 @@ PE.ApplicationController = new(function(){
}
function onPrintUrl(url) {
common.utils.dialogPrint(url);
common.utils.dialogPrint(url, api);
}
function hidePreloader() {

View file

@ -1778,10 +1778,14 @@ define([
this.iframePrint.style.bottom = "0";
document.body.appendChild(this.iframePrint);
this.iframePrint.onload = function() {
try {
me.iframePrint.contentWindow.focus();
me.iframePrint.contentWindow.print();
me.iframePrint.contentWindow.blur();
window.focus();
} catch (e) {
me.api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
}
};
}
if (url) this.iframePrint.src = url;

View file

@ -160,7 +160,7 @@ SSE.ApplicationController = new(function(){
}
function onPrintUrl(url) {
common.utils.dialogPrint(url);
common.utils.dialogPrint(url, api);
}
function hidePreloader() {

View file

@ -2015,10 +2015,14 @@ define([
this.iframePrint.style.bottom = "0";
document.body.appendChild(this.iframePrint);
this.iframePrint.onload = function() {
try {
me.iframePrint.contentWindow.focus();
me.iframePrint.contentWindow.print();
me.iframePrint.contentWindow.blur();
window.focus();
} catch (e) {
me.api.asc_DownloadAs(Asc.c_oAscFileType.PDF, false, me.getApplication().getController('Print').getPrintParams());
}
};
}
if (url) this.iframePrint.src = url;

View file

@ -348,7 +348,11 @@ define([
this._changedProps[panel.cmbSheet.getValue()] = this.getPageOptions(panel);
}
},
getPrintParams: function() {
return this.adjPrintParams;
},
warnCheckMargings: 'Margins are incorrect',
strAllSheets: 'All Sheets',
textWarning: 'Warning',