From 7b2f091be5798c68ba324873a41b2e3349cbeb02 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 1 Sep 2020 14:08:41 +0300 Subject: [PATCH] [embed] fix bug 33455 --- .../embed/resources/img/icon-menu-sprite.svg | 81 ++++++++++++++++++- apps/common/embed/resources/less/common.less | 38 +++++---- .../embed/js/ApplicationController.js | 9 +++ .../embed/js/ApplicationView.js | 2 + apps/documenteditor/embed/locale/en.json | 1 + 5 files changed, 115 insertions(+), 16 deletions(-) diff --git a/apps/common/embed/resources/img/icon-menu-sprite.svg b/apps/common/embed/resources/img/icon-menu-sprite.svg index fa83c4dc7..773879001 100644 --- a/apps/common/embed/resources/img/icon-menu-sprite.svg +++ b/apps/common/embed/resources/img/icon-menu-sprite.svg @@ -1 +1,80 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/common/embed/resources/less/common.less b/apps/common/embed/resources/less/common.less index 3a12327a6..d5365a424 100644 --- a/apps/common/embed/resources/less/common.less +++ b/apps/common/embed/resources/less/common.less @@ -428,47 +428,53 @@ &.big-email { .socnet-btn(3); } } +@icon-width: 20px; +@icon-height: 20px; .svg-icon { background: data-uri('../../../../common/embed/resources/img/icon-menu-sprite.svg') no-repeat; - background-size: 22px*11 22px*2; + background-size: @icon-width*13 @icon-height*2; &.download { - background-position: -22px 0; + background-position: -@icon-width 0; } &.share { - background-position: -22px*2 0; + background-position: -@icon-width*2 0; } &.embed { - background-position: -22px*3 0; + background-position: -@icon-width*3 0; } &.fullscr { - background-position: -22px*4 0; + background-position: -@icon-width*4 0; } &.zoom-up { - background-position: -22px*5 -22px; + background-position: -@icon-width*5 -@icon-height; } &.zoom-down { - background-position: -22px*6 -22px; + background-position: -@icon-width*6 -@icon-height; } &.slide-prev { - background-position: -22px*7 -22px; + background-position: -@icon-width*7 -@icon-height; } &.slide-next { - background-position: -22px*8 -22px; + background-position: -@icon-width*8 -@icon-height; } &.play { - background-position: -22px*9 -22px; + background-position: -@icon-width*9 -@icon-height; } &.pause { - background-position: -22px*10 -22px; + background-position: -@icon-width*10 -@icon-height; + } + + &.print { + background-position: -@icon-width*11 0; } } .mi-icon { - width: 22px; - height: 22px; + width: @icon-width; + height: @icon-height; //display: inline-block; float: left; margin: -1px 15px 0 -15px; @@ -550,7 +556,7 @@ &.open { > button { background-color: @btnActiveColor; - background-position: 0 -22px; + background-position: 0 -@icon-height; } } } @@ -559,9 +565,11 @@ button { width: 24px; height: 22px; + background-origin: content-box; + padding: 0 1px; &:active { - background-position: 0 -22px; + background-position: 0 -@icon-height; } } diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 8eef26616..1798f3976 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -229,6 +229,9 @@ DE.ApplicationController = new(function(){ if ( !embedConfig.saveUrl && permissions.print === false) $('#idt-download').hide(); + if ( permissions.print === false) + $('#idt-print').hide(); + if ( !embedConfig.shareUrl ) $('#idt-share').hide(); @@ -276,6 +279,12 @@ DE.ApplicationController = new(function(){ Common.Analytics.trackEvent('Save'); }); + DE.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) diff --git a/apps/documenteditor/embed/js/ApplicationView.js b/apps/documenteditor/embed/js/ApplicationView.js index 1c3aca46f..9a07a68ea 100644 --- a/apps/documenteditor/embed/js/ApplicationView.js +++ b/apps/documenteditor/embed/js/ApplicationView.js @@ -46,6 +46,7 @@ DE.ApplicationView = new(function(){ $btnTools.parent().append( '