-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add enable/disable options to document handlers for a11y and menu #499
Conversation
Remember that you can turn off the white-space differences to ignore the indentation changes, which makes it easier to see the "real" changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that the code becomes a lot more concise.
However, there is one part I do not fully understand.
While enableMenu
allows me to disable the menu as an option settings, enableEnrich
and enableExplorer
can not be set in options (even with enableMenu
true and while I can see the on the document.options
).
@@ -156,6 +160,7 @@ B extends MathDocumentConstructor<AbstractMathDocument<N, T, D>>>( | |||
*/ | |||
public static OPTIONS: OptionList = { | |||
...BaseDocument.OPTIONS, | |||
enableAssistiveMml: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wanted to set this to false in 3.1
and instead have accessibility switched on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to do that in a separate PR. I always want to do some testing to see what the performance impact is before making that change.
These options are only available when the corresponding component file is loaded. The menu component is included in the main combined components (like Perhaps I misunderstood what you wanted in terms of control of these components. This was intended to give programmatic control over the components once they are loaded (like from the menu), and to allow you to disable a component if it is included in a combined component, for example. It was not intended to control the loading of the component, which is done via the If you have a different behavior in mind, we can revisit this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm.
This PR adds enable/disable document options for the a11y and menu document handlers so that these options can be controlled programmatically more easily. These are the
enableExplorer
,enableMenu
, etc. options in the various MathDocument mixins.This makes it unnecessary to override the
explorer()
,enrich()
(and similar methods) in the menu code, which simplifies the MenuHandler considerably. The testing that was done in these routines has been moved to thecheckLoading()
render action. This makes the menu handler cleaner all around; I was never happy about the overriding that was being done there.I also normalized the handling of the state and process bits in some places, so that the states are set even if the action is skipped (so that attempting the actions that are skipped won't be repeated in the future). This causes some changes in indentation, and makes some of the diffs seem more substantial than they are.
Finally, I added
force
parameters to force the processing even when the enable options are off (so, for example, the complexity computations can force enrichment even if enrichment is disabled).