[PDFE] Add comment button

This commit is contained in:
Julia Radzhabova
2023-07-26 23:14:57 +03:00
parent 470fdcc1ba
commit 2552092eea
3 changed files with 21 additions and 1 deletions

View File

@ -171,6 +171,9 @@ define([
toolbar.btnSelectAll.on('click', _.bind(this.onSelectAll, this));
toolbar.btnSelectTool.on('click', _.bind(this.onSelectTool, this, 'select'));
toolbar.btnHandTool.on('click', _.bind(this.onSelectTool, this, 'hand'));
toolbar.btnAddComment.on('click', function (btn, e) {
Common.NotificationCenter.trigger('app:comment:add', 'toolbar');
});
this.onBtnChangeState('undo:disabled', toolbar.btnUndo, toolbar.btnUndo.isDisabled());
this.onBtnChangeState('redo:disabled', toolbar.btnRedo, toolbar.btnRedo.isDisabled());

View File

@ -43,6 +43,7 @@
<section class="box-panels">
<section class="panel" data-tab="home">
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-comment"></span>
</div>
</section>
</section>

View File

@ -261,6 +261,18 @@ define([
});
this.toolbarControls.push(this.btnHandTool);
this.btnAddComment = new Common.UI.Button({
id: 'tlbtn-addcomment',
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-big-menu-comments',
lock: [_set.disableOnStart],
caption: this.capBtnComment,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.toolbarControls.push(this.btnAddComment);
//
// Menus
//
@ -347,6 +359,7 @@ define([
_injectComponent('#slot-btn-select-all', this.btnSelectAll);
_injectComponent('#slot-btn-select-tool', this.btnSelectTool);
_injectComponent('#slot-btn-hand-tool', this.btnHandTool);
_injectComponent('#slot-btn-comment', this.btnAddComment);
this.btnPrint.menu && this.btnPrint.$el.addClass('split');
return $host;
@ -401,6 +414,7 @@ define([
this.btnSelectAll.updateHint(this.tipSelectAll + Common.Utils.String.platformKey('Ctrl+A'));
this.btnSelectTool.updateHint(this.tipSelectTool);
this.btnHandTool.updateHint(this.tipHandTool);
this.btnAddComment.updateHint(this.tipAddComment);
},
onToolbarAfterRender: function(toolbar) {
@ -560,7 +574,9 @@ define([
textTabView: 'View',
tipSelectAll: 'Select all',
tipCut: 'Cut',
textTabDraw: 'Draw'
textTabDraw: 'Draw',
capBtnComment: 'Comment',
tipAddComment: 'Add comment'
}
})(), PDFE.Views.Toolbar || {}));
});