[embed] fix bug 33455

This commit is contained in:
Maxim Kadushkin 2020-09-08 20:40:18 +03:00
parent 16903c287c
commit 61788fa804
6 changed files with 24 additions and 0 deletions

View file

@ -230,6 +230,9 @@ PE.ApplicationController = new(function(){
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -1);
(zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100));
if ( permissions.print === false)
$('#idt-print').hide();
if (!embedConfig.saveUrl && permissions.print === false)
$('#idt-download').hide();
@ -284,6 +287,12 @@ PE.ApplicationController = new(function(){
Common.Analytics.trackEvent('Save');
});
PE.ApplicationView.tools.get('#idt-print')
.on('click', function(){
api.asc_Print(new Asc.asc_CDownloadOptions(null, $.browser.chrome || $.browser.safari || $.browser.opera));
Common.Analytics.trackEvent('Print');
});
var $pagenum = $('#page-number');
$pagenum.on({
'keyup': function(e){

View file

@ -46,6 +46,7 @@ PE.ApplicationView = new(function(){
$btnTools.parent().append(
'<ul class="dropdown-menu">' +
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
'<li><a id="idt-embed" data-toggle="modal"><span class="mi-icon svg-icon embed"></span>' + this.txtEmbed + '</a></li>' +
'<li><a id="idt-fullscreen"><span class="mi-icon svg-icon fullscr"></span>' + this.txtFullScreen + '</a></li>' +
@ -63,6 +64,7 @@ PE.ApplicationView = new(function(){
},
txtDownload: 'Download',
txtPrint: 'Print',
txtShare: 'Share',
txtEmbed: 'Embed',
txtFullScreen: 'Full Screen'

View file

@ -24,6 +24,7 @@
"PE.ApplicationController.unsupportedBrowserErrorText": "Your browser is not supported.",
"PE.ApplicationController.waitText": "Please, wait...",
"PE.ApplicationView.txtDownload": "Download",
"PE.ApplicationView.txtPrint": "Print",
"PE.ApplicationView.txtEmbed": "Embed",
"PE.ApplicationView.txtFullScreen": "Full Screen",
"PE.ApplicationView.txtShare": "Share"

View file

@ -175,6 +175,9 @@ SSE.ApplicationController = new(function(){
function onDocumentContentReady() {
hidePreloader();
if ( permissions.print === false)
$('#idt-print').hide();
if ( !embedConfig.saveUrl && permissions.print === false)
$('#idt-download').hide();
@ -221,6 +224,12 @@ SSE.ApplicationController = new(function(){
Common.Analytics.trackEvent('Save');
});
SSE.ApplicationView.tools.get('#idt-print')
.on('click', function(){
api.asc_Print(new Asc.asc_CDownloadOptions(null, $.browser.chrome || $.browser.safari || $.browser.opera));
Common.Analytics.trackEvent('Print');
});
$('#id-btn-close').on('click', function(){
if (config.customization && config.customization.goback) {
if (config.customization.goback.requestClose && config.canRequestClose)

View file

@ -47,6 +47,7 @@ SSE.ApplicationView = new(function(){
$btnTools.parent().append(
'<ul class="dropdown-menu">' +
'<li><a id="idt-download"><span class="mi-icon svg-icon download"></span>' + this.txtDownload + '</a></li>' +
'<li><a id="idt-print"><span class="mi-icon svg-icon print"></span>' + this.txtPrint + '</a></li>' +
'<li><a id="idt-share" data-toggle="modal"><span class="mi-icon svg-icon share"></span>' + this.txtShare + '</a></li>' +
'<li><a id="idt-embed" data-toggle="modal"><span class="mi-icon svg-icon embed"></span>' + this.txtEmbed + '</a></li>' +
'<li><a id="idt-fullscreen"><span class="mi-icon svg-icon fullscr"></span>' + this.txtFullScreen + '</a></li>' +
@ -64,6 +65,7 @@ SSE.ApplicationView = new(function(){
},
txtDownload: 'Download',
txtPrint: 'Print',
txtShare: 'Share',
txtEmbed: 'Embed',
txtFullScreen: 'Full Screen'

View file

@ -24,6 +24,7 @@
"SSE.ApplicationController.unsupportedBrowserErrorText": "Your browser is not supported.",
"SSE.ApplicationController.waitText": "Please, wait...",
"SSE.ApplicationView.txtDownload": "Download",
"SSE.ApplicationView.txtPrint": "Print",
"SSE.ApplicationView.txtEmbed": "Embed",
"SSE.ApplicationView.txtFullScreen": "Full Screen",
"SSE.ApplicationView.txtShare": "Share"