diff --git a/apps/pdfeditor/main/app/controller/Toolbar.js b/apps/pdfeditor/main/app/controller/Toolbar.js index 15b080531b..cc2e6d5955 100644 --- a/apps/pdfeditor/main/app/controller/Toolbar.js +++ b/apps/pdfeditor/main/app/controller/Toolbar.js @@ -173,6 +173,8 @@ define([ toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, 'copy')); toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, 'paste')); toolbar.btnCut.on('click', _.bind(this.onCopyPaste, this, 'cut')); + toolbar.btnSelectTool.on('toggle', _.bind(this.onSelectTool, this, 'select')); + toolbar.btnHandTool.on('toggle', _.bind(this.onSelectTool, this, 'hand')); toolbar.fieldPages.on('changed:after', _.bind(this.onPagesChanged, this)); toolbar.fieldPages.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me.toolbar);}); toolbar.fieldPages.cmpEl && toolbar.fieldPages.cmpEl.on('focus', 'input.form-control', function() { @@ -189,8 +191,6 @@ define([ if (this.mode && this.mode.isEdit) { toolbar.btnSave.on('click', _.bind(this.tryToSave, this)); toolbar.btnSelectAll.on('click', _.bind(this.onSelectAll, this)); - toolbar.btnSelectTool.on('toggle', _.bind(this.onSelectTool, this, 'select')); - toolbar.btnHandTool.on('toggle', _.bind(this.onSelectTool, this, 'hand')); toolbar.btnAddComment.on('click', function (btn, e) { Common.NotificationCenter.trigger('app:comment:add', 'toolbar'); }); @@ -562,7 +562,7 @@ define([ }, turnOnSelectTool: function() { - if (this.mode.isEdit && this.toolbar && this.toolbar.btnSelectTool && !this.toolbar.btnSelectTool.isActive()) { + if ((this.mode.isEdit && this.mode.isRestrictedEdit) && this.toolbar && this.toolbar.btnSelectTool && !this.toolbar.btnSelectTool.isActive()) { this.api.asc_setViewerTargetType('select'); this.toolbar.btnSelectTool.toggle(true, true); this.toolbar.btnHandTool.toggle(false, true); @@ -933,7 +933,7 @@ define([ (new Promise(function(accept) { accept(); })).then(function () { - config.isEdit && me.toolbar && me.toolbar.btnHandTool.toggle(true, true); + (config.isEdit || config.isRestrictedEdit) && me.toolbar && me.toolbar.btnHandTool.toggle(true, true); me.api && me.api.asc_setViewerTargetType('hand'); }); }, diff --git a/apps/pdfeditor/main/app/template/Toolbar.template b/apps/pdfeditor/main/app/template/Toolbar.template index cd32b37e81..91c048da0b 100644 --- a/apps/pdfeditor/main/app/template/Toolbar.template +++ b/apps/pdfeditor/main/app/template/Toolbar.template @@ -34,29 +34,14 @@
- <% if ( typeof config !== "undefined" && config.isEdit) { %>
- <% } %>
- <% if ( typeof config !== "undefined" && config.isRestrictedEdit) { %> -
- - - -
-
-
- - -
-
- <% } %>
@@ -89,6 +74,19 @@
+ <% if ( typeof config !== "undefined" && config.isRestrictedEdit) { %> +
+
+ + + +
+
+
+ + +
+ <% } %>
diff --git a/apps/pdfeditor/main/app/view/Toolbar.js b/apps/pdfeditor/main/app/view/Toolbar.js index a7a594f0e3..e0aa8ce656 100644 --- a/apps/pdfeditor/main/app/view/Toolbar.js +++ b/apps/pdfeditor/main/app/view/Toolbar.js @@ -148,36 +148,6 @@ define([ this.toolbarControls.push(this.btnSave); this.btnCollabChanges = this.btnSave; - this.btnSelectTool = new Common.UI.Button({ - id: 'tlbtn-selecttool', - cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-select', - lock: [_set.disableOnStart], - caption: me.capBtnSelect, - toggleGroup: 'select-tools-tb', - enableToggle: true, - allowDepress: false, - dataHint: '1', - dataHintDirection: 'bottom', - dataHintOffset: 'small' - }); - this.toolbarControls.push(this.btnSelectTool); - - this.btnHandTool = new Common.UI.Button({ - id: 'tlbtn-handtool', - cls: 'btn-toolbar x-huge icon-top', - iconCls: 'toolbar__icon btn-big-hand-tool', - lock: [_set.disableOnStart], - caption: me.capBtnHand, - toggleGroup: 'select-tools-tb', - enableToggle: true, - allowDepress: false, - dataHint: '1', - dataHintDirection: 'bottom', - dataHintOffset: 'small' - }); - this.toolbarControls.push(this.btnHandTool); - // this.btnRotate = new Common.UI.Button({ // id: 'tlbtn-rotate', // cls: 'btn-toolbar x-huge icon-top', @@ -423,6 +393,36 @@ define([ }); this.toolbarControls.push(this.btnSelectAll); + this.btnSelectTool = new Common.UI.Button({ + id: 'tlbtn-selecttool', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-select', + lock: [_set.disableOnStart], + caption: me.capBtnSelect, + toggleGroup: 'select-tools-tb', + enableToggle: true, + allowDepress: false, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.toolbarControls.push(this.btnSelectTool); + + this.btnHandTool = new Common.UI.Button({ + id: 'tlbtn-handtool', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-big-hand-tool', + lock: [_set.disableOnStart], + caption: me.capBtnHand, + toggleGroup: 'select-tools-tb', + enableToggle: true, + allowDepress: false, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.toolbarControls.push(this.btnHandTool); + this.fieldPages = new Common.UI.InputFieldFixed({ id: 'id-toolbar-txt-pages', style : 'width: 100%;', @@ -703,14 +703,11 @@ define([ // set hints if (this.mode.isEdit) { this.btnSave.updateHint(this.btnSaveTip); - this.btnSelectTool.updateHint(this.tipSelectTool); - this.btnHandTool.updateHint(this.tipHandTool); this.btnAddComment.updateHint(this.tipAddComment); this.btnStrikeout.updateHint(this.textStrikeout); this.btnUnderline.updateHint(this.textUnderline); this.btnHighlight.updateHint(this.textHighlight); // this.btnRotate.updateHint(this.tipRotate); - } else if (this.mode.isRestrictedEdit) { this.btnClear.updateHint(this.textClearFields); this.btnPrevForm.updateHint(this.tipPrevForm); @@ -725,6 +722,8 @@ define([ this.btnPaste.updateHint(this.tipPaste + Common.Utils.String.platformKey('Ctrl+V')); this.btnCut.updateHint(this.tipCut + Common.Utils.String.platformKey('Ctrl+X')); this.btnSelectAll.updateHint(this.tipSelectAll + Common.Utils.String.platformKey('Ctrl+A')); + this.btnSelectTool.updateHint(this.tipSelectTool); + this.btnHandTool.updateHint(this.tipHandTool); this.btnFirstPage.updateHint(this.tipFirstPage); this.btnLastPage.updateHint(this.tipLastPage); this.btnPrevPage.updateHint(this.tipPrevPage);