Skip to content

Commit

Permalink
[Embedded] Fix hiding download button and settings menu. (ONLYOFFICE#263
Browse files Browse the repository at this point in the history
)
  • Loading branch information
JuliaRadzhabova authored and agolybev committed Nov 12, 2019
1 parent 933a0d0 commit a6d4dc6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions apps/documenteditor/embed/js/ApplicationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ DE.ApplicationController = new(function(){
}

embedConfig.docTitle = docConfig.title;
if ( !embedConfig.saveUrl && permissions.print === false)
$('#idt-copy').hide();
}
}

Expand Down Expand Up @@ -221,6 +219,9 @@ DE.ApplicationController = new(function(){
var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -2);
(zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100));

if ( !embedConfig.saveUrl && permissions.print === false)
$('#idt-download').hide();

if ( !embedConfig.shareUrl )
$('#idt-share').hide();

Expand All @@ -230,6 +231,9 @@ DE.ApplicationController = new(function(){
if ( !embedConfig.fullscreenUrl )
$('#idt-fullscreen').hide();

if ( !embedConfig.saveUrl && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl)
$('#box-tools').addClass('hidden');

common.controller.modals.attach({
share: '#idt-share',
embed: '#idt-embed'
Expand Down
8 changes: 6 additions & 2 deletions apps/presentationeditor/embed/js/ApplicationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ PE.ApplicationController = new(function(){
}

embedConfig.docTitle = docConfig.title;
if (!embedConfig.saveUrl && permissions.print === false)
$('#idt-copy').hide();
}
}

Expand Down Expand Up @@ -225,6 +223,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 (!embedConfig.saveUrl && permissions.print === false)
$('#idt-download').hide();

if ( !embedConfig.shareUrl )
$('#idt-share').hide();

Expand All @@ -234,6 +235,9 @@ PE.ApplicationController = new(function(){
if ( !embedConfig.fullscreenUrl )
$('#idt-fullscreen').hide();

if ( !embedConfig.saveUrl && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl)
$('#box-tools').addClass('hidden');

common.controller.modals.attach({
share: '#idt-share',
embed: '#idt-embed'
Expand Down
8 changes: 6 additions & 2 deletions apps/spreadsheeteditor/embed/js/ApplicationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ SSE.ApplicationController = new(function(){
}

embedConfig.docTitle = docConfig.title;
if ( !embedConfig.saveUrl && permissions.print === false)
$('#idt-copy').hide();
}
}

Expand Down Expand Up @@ -170,6 +168,9 @@ SSE.ApplicationController = new(function(){
function onDocumentContentReady() {
hidePreloader();

if ( !embedConfig.saveUrl && permissions.print === false)
$('#idt-download').hide();

if ( !embedConfig.shareUrl )
$('#idt-share').hide();

Expand All @@ -179,6 +180,9 @@ SSE.ApplicationController = new(function(){
if ( !embedConfig.fullscreenUrl )
$('#idt-fullscreen').hide();

if ( !embedConfig.saveUrl && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl)
$('#box-tools').addClass('hidden');

common.controller.modals.attach({
share: '#idt-share',
embed: '#idt-embed'
Expand Down

0 comments on commit a6d4dc6

Please sign in to comment.