Skip to content
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

fix: deselect and prevent toolbar buttons enabling #820

Merged
merged 4 commits into from
Jul 26, 2021

Conversation

SystemChanger
Copy link
Contributor

@SystemChanger SystemChanger commented Jul 25, 2021

Calling "readOnly(true)" didn't disable controllers (and other menus) resulting in incorrect buttons display state (blur off) after the selection is changed.
"Enabled" dialogs (opened) and buttons (not blurred) resulted in ability to modify the contents when it should be prohibited.

UPD. Same for "disabled()"

@JiHong88
Copy link
Owner

Hi @SystemChanger
The "more" button is intentionally enabled when "readOnly" or "disabled".
All buttons in "more layer" are disabled or abled depending on the type.

@SystemChanger
Copy link
Contributor Author

@JiHong88
I can get it for "readOnly" but "disabled" affects the entire toolbar and "more layer" just takes up space.
Toolbar in "disabled" is blocked by this line: context.tool.cover.style.display = 'block';
So I think that for "disabled" we can have the following code:

/** off menus */
core.submenuOff();
core.moreLayerOff();
core.containerOff();
core.controllersOff();
if (core.modalForm) core.plugins.dialog.close.call(core);

for readOnly:

/** off menus */
core.controllersOff();
if (core.modalForm) core.plugins.dialog.close.call(core);

I have also removed the if (core.notice) core.notice.close.call(core); line in my examples above.
"Controllers" and "modal form" should definitely be disabled cause they brings the major problems.

Also founded some issues with "readOnly" and will make card (issue) for them later.

@JiHong88
Copy link
Owner

@SystemChanger Thank for your contribution :)
I'll notify you after the version updated.

@JiHong88 JiHong88 merged commit f6f3352 into JiHong88:master Jul 26, 2021
@JiHong88
Copy link
Owner

@SystemChanger The 2.42.0 version has been updated.
If this issue has not been resolved, please reopen this issue.
Thank you.

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.

2 participants