diff --git a/apps/documenteditor/embed/index.html.deploy b/apps/documenteditor/embed/index.html.deploy
index 0bf2894db..0bc36adf3 100644
--- a/apps/documenteditor/embed/index.html.deploy
+++ b/apps/documenteditor/embed/index.html.deploy
@@ -190,7 +190,6 @@
-
of 0
diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js
index 35b006854..2df136dcf 100644
--- a/apps/documenteditor/embed/js/ApplicationController.js
+++ b/apps/documenteditor/embed/js/ApplicationController.js
@@ -401,7 +401,6 @@ DE.ApplicationController = new(function(){
if ( permissions.print === false) {
$('#idt-print').hide();
- $(dividers[0]).hide();
itemsCount--;
}
@@ -413,8 +412,6 @@ DE.ApplicationController = new(function(){
if ( !appOptions.canFillForms || permissions.download === false) {
$('#idt-download-docx').hide();
$('#idt-download-pdf').hide();
- $(dividers[0]).hide();
- $(dividers[1]).hide();
itemsCount -= 2;
}
@@ -428,8 +425,10 @@ DE.ApplicationController = new(function(){
itemsCount--;
}
- if (itemsCount<3)
- $(dividers[2]).hide();
+ if (itemsCount < 7) {
+ $(dividers[0]).hide();
+ $(dividers[1]).hide();
+ }
if ( !embedConfig.embedUrl || appOptions.canFillForms) {
$('#idt-embed').hide();
@@ -451,10 +450,6 @@ DE.ApplicationController = new(function(){
embed: '#idt-embed'
});
- common.controller.SearchBar.attach({
- search: '#id-search'
- });
-
api.asc_registerCallback('asc_onStartAction', onLongActionBegin);
api.asc_registerCallback('asc_onEndAction', onLongActionEnd);
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
@@ -524,6 +519,11 @@ DE.ApplicationController = new(function(){
downloadAs(Asc.c_oAscFileType.PDF);
});
+ DE.ApplicationView.tools.get('#idt-search')
+ .on('click', function(){
+ common.controller.SearchBar.show();
+ });
+
$('#id-btn-zoom-in').on('click', api.zoomIn.bind(this));
$('#id-btn-zoom-out').on('click', api.zoomOut.bind(this));
diff --git a/apps/documenteditor/embed/js/ApplicationView.js b/apps/documenteditor/embed/js/ApplicationView.js
index 0f74bdaf0..5ef35c142 100644
--- a/apps/documenteditor/embed/js/ApplicationView.js
+++ b/apps/documenteditor/embed/js/ApplicationView.js
@@ -46,11 +46,12 @@ DE.ApplicationView = new(function(){
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
$btnTools.parent().append(
'
-
of 0
diff --git a/apps/presentationeditor/embed/index.html.deploy b/apps/presentationeditor/embed/index.html.deploy
index 94070e1fe..9bc17c3b2 100644
--- a/apps/presentationeditor/embed/index.html.deploy
+++ b/apps/presentationeditor/embed/index.html.deploy
@@ -244,7 +244,6 @@
-
of 0
diff --git a/apps/presentationeditor/embed/js/ApplicationController.js b/apps/presentationeditor/embed/js/ApplicationController.js
index 5545b75f6..08e95521f 100644
--- a/apps/presentationeditor/embed/js/ApplicationController.js
+++ b/apps/presentationeditor/embed/js/ApplicationController.js
@@ -265,38 +265,57 @@ 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)
+ var dividers = $('#box-tools .divider');
+ var itemsCount = $('#box-tools a').length;
+
+ $('#idt-search').hide(); // TO DO: remove when search will be ready
+ itemsCount--;
+
+ if ( permissions.print === false) {
$('#idt-print').hide();
+ itemsCount--;
+ }
- if (!embedConfig.saveUrl || permissions.download === false)
+ if (!embedConfig.saveUrl || permissions.download === false) {
$('#idt-download').hide();
+ itemsCount--;
+ }
- if ( !embedConfig.shareUrl )
+ if ( !embedConfig.shareUrl ) {
$('#idt-share').hide();
+ itemsCount--;
+ }
- if (!config.canBackToFolder)
+ if (!config.canBackToFolder) {
$('#idt-close').hide();
+ itemsCount--;
+ }
- if ( !embedConfig.embedUrl )
+ if (itemsCount < 7) {
+ $(dividers[0]).hide();
+ $(dividers[1]).hide();
+ }
+
+ if ( !embedConfig.embedUrl ) {
$('#idt-embed').hide();
+ itemsCount--;
+ }
- if ( !embedConfig.fullscreenUrl )
+ if ( !embedConfig.fullscreenUrl ) {
$('#idt-fullscreen').hide();
+ itemsCount--;
+ }
- if ( (!embedConfig.saveUrl || permissions.download === false) && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl && !config.canBackToFolder)
+ if (itemsCount < 1)
$('#box-tools').addClass('hidden');
else if (!embedConfig.embedUrl && !embedConfig.fullscreenUrl)
- $('#box-tools .divider').hide();
+ $(dividers[2]).hide();
common.controller.modals.attach({
share: '#idt-share',
embed: '#idt-embed'
});
- common.controller.SearchBar.attach({
- search: '#id-search'
- });
-
api.asc_registerCallback('asc_onMouseMoveStart', onDocMouseMoveStart);
api.asc_registerCallback('asc_onMouseMoveEnd', onDocMouseMoveEnd);
api.asc_registerCallback('asc_onMouseMove', onDocMouseMove);
@@ -350,6 +369,11 @@ PE.ApplicationController = new(function(){
}
});
+ PE.ApplicationView.tools.get('#idt-search')
+ .on('click', function(){
+ common.controller.SearchBar.show();
+ });
+
var $pagenum = $('#page-number');
$pagenum.on({
'keyup': function(e){
diff --git a/apps/presentationeditor/embed/js/ApplicationView.js b/apps/presentationeditor/embed/js/ApplicationView.js
index 613087c00..5b4d8ac0e 100644
--- a/apps/presentationeditor/embed/js/ApplicationView.js
+++ b/apps/presentationeditor/embed/js/ApplicationView.js
@@ -45,8 +45,11 @@ PE.ApplicationView = new(function(){
$btnTools.addClass('dropdown-toggle').attr('data-toggle', 'dropdown').attr('aria-expanded', 'true');
$btnTools.parent().append(
'