Skip to content

Enable disable toolbar width#1415

Closed
Alex-Jordan wants to merge 1 commit into
openwebwork:PG-2.21from
Alex-Jordan:enable-disable-toolbar-width
Closed

Enable disable toolbar width#1415
Alex-Jordan wants to merge 1 commit into
openwebwork:PG-2.21from
Alex-Jordan:enable-disable-toolbar-width

Conversation

@Alex-Jordan
Copy link
Copy Markdown
Contributor

A bootstrap class that is used with the "Disable Toolbar" popover for the MQ editor has min-width set to something, and it makes excess whitespace following the "Disable Toolbar".

Before:

Screenshot 2026-05-23 at 11 17 05 AM

After:

Screenshot 2026-05-23 at 11 16 57 AM

@Alex-Jordan Alex-Jordan changed the base branch from main to PG-2.21 May 23, 2026 18:17

const menuEl = document.createElement('ul');
menuEl.classList.add('dropdown-menu');
menuEl.style.setProperty('min-width', 'unset');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than setting this with JavaScript, you should add a custom class on line 529 above (so make that line something like menuEl.classList.add('dropdown-menu', 'mqeditor-menu');), and then add

.mqeditor-menu {
	min-width: unset;
}

to the mqeditor.scss file.

Also, a nicer way to do this in JavaScript is with menuEl.style.minWidth = 'unset';. Although, that is just my preference.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I king of like just setting this in JavaScript. Just less code. So leave it as is, or change to the suggested. Either is fine.

@somiaj
Copy link
Copy Markdown
Contributor

somiaj commented May 23, 2026

Should this be delayed or not needed after the toolbar is redone, in #1417?

@drgrice1
Copy link
Copy Markdown
Member

It can be merged, but I also added this to the code in openwebwork/mathquill#46. So thanks for finding this in any case.

@Alex-Jordan
Copy link
Copy Markdown
Contributor Author

If the issue is covered by #1417, I'll close this. Reopen if I misunderstood.

@drgrice1
Copy link
Copy Markdown
Member

It is covered by #1417, but only because you opened this pull request and I added the changes here to the changes to the toolbar code that is now part of the MathQuill code. So thanks for noticing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants