notebookbar: event prevent default for insert annotation button

problem:
if writer->insert tab-> insert comment button is clicked,
if button is clicked from icon is works fine,
but if button is clicked on label event is triggered twice,
which caused js errors

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I3956083b02204733abc3543c73f6019d3a3b4c67
pull/8416/head
Pranam Lashkari 2024-02-27 03:45:14 +05:30 committed by Szymon Kłos
parent 2d31aafa11
commit 537959188f
1 changed files with 2 additions and 1 deletions

View File

@ -943,7 +943,8 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
_insertAnnotationControl: function(parentContainer, data, builder) {
var control = builder._unoToolButton(parentContainer, data, builder);
$(control.container).unbind('click.toolbutton');
$(control.container).click(function () {
$(control.container).click(function (e) {
e.preventDefault();
var docLayer = builder.map._docLayer;
if (!(docLayer._docType === 'spreadsheet' && docLayer._hasActiveSelection)) {
builder.map.insertComment();