Skip to content

Commit

Permalink
jsdialog: fix id for buttons with menu #7548
Browse files Browse the repository at this point in the history
- fixes regression from Accessibility commit 1a2500c
- 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 authored and pedropintosilva committed Oct 31, 2023
1 parent ef66c84 commit 40f0008
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion browser/src/control/Control.FormulaBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ L.Map.include({
mobileTopBar.show('undo');
mobileTopBar.show('redo');

$('#AutoSumMenuimg').css('margin-inline', '0');
$('#AutoSumMenu-button').css('margin-inline', '0');
$('#AutoSumMenu .unoarrow').css('margin', '0');

jsdialogFormulabar.show('startformula');
Expand Down
8 changes: 2 additions & 6 deletions browser/src/control/Control.FormulaBarJSDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ L.Control.FormulaBarJSDialog = L.Control.extend({
command: '.uno:FunctionDialog'
},
{
id: 'autosummenu:AutoSumMenu',
id: 'AutoSumMenu:AutoSumMenu',
type: 'menubutton',
class: 'AutoSumMenu',
command: '.uno:AutoSumMenu'
},
{
Expand Down Expand Up @@ -308,11 +309,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
2 changes: 2 additions & 0 deletions browser/src/control/jsdialog/Widget.MenuButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ function _menubuttonControl (parentContainer, data, builder) {
if (data.id.includes(':')) {
ids = data.id.split(':');
menuId = ids[1];
data.id = ids[0];
}
else if (data.id.includes('-')) {
ids = data.id.split('-');
menuId = ids[1];
data.id = ids[0];
}
else
menuId = data.id;
Expand Down

0 comments on commit 40f0008

Please sign in to comment.