Skip to content

Commit

Permalink
jsdialog: fix id for buttons with menu #7548
Browse files Browse the repository at this point in the history
- it fixes formulabar control of AutoSum button #7548
- removes useless commit a7ece5d:
  jsdialog: reduce warnings in console for formulabar
- id with ":" contains "id : menuId", so we can identify
  menu which should be used, let's not use whole string as
  HTML element id - we don't want ":" there

Signed-off-by: Szymon Kłos <[email protected]>
Change-Id: I44adde54b852f1e6593fb660612d8116aadf3b39
  • Loading branch information
eszkadev committed Oct 27, 2023
1 parent 8a5a1b7 commit 30d7767
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 1 addition & 6 deletions browser/src/control/Control.FormulaBarJSDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ L.Control.FormulaBarJSDialog = L.Control.extend({
command: '.uno:FunctionDialog'
},
{
id: 'autosummenu:AutoSumMenu',
id: 'AutoSumMenu:AutoSumMenu',
type: 'menubutton',
command: '.uno:AutoSumMenu'
},
Expand Down Expand Up @@ -308,11 +308,6 @@ L.Control.FormulaBarJSDialog = L.Control.extend({
return;
}

// ignore some actions to not spam in the console, we don't support them now
if ((window.mode.isMobile() && innerData.control_id === 'startformula')
|| innerData.control_id === 'AutoSumMenu')
return;

this.builder.executeAction(this.container, innerData);
} else
this.createFormulabar(innerData.text);
Expand Down
4 changes: 4 additions & 0 deletions browser/src/control/Control.JSDialogBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2392,6 +2392,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (isRealUnoCommand)
id = builder._makeIdUnique(id);

var menuIdSeparatorPos = id.indexOf(':');
if (menuIdSeparatorPos > 0)
id = id.substr(0, menuIdSeparatorPos);

div.id = id;
data.id = id; // change in input data for postprocess

Expand Down

0 comments on commit 30d7767

Please sign in to comment.