Skip to content

Readonly mode #4

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

Open
carlosvega opened this issue Feb 10, 2021 · 5 comments
Open

Readonly mode #4

carlosvega opened this issue Feb 10, 2021 · 5 comments

Comments

@carlosvega
Copy link

After going through the great documentation of this project I have been unable to find any reference to readonly mode.
Is there any way to make the vsm-boxes readonly?, preventing the user from making any change but still able to show the popup for detailed information about the terms?

Thank you very much in advance.

@stcruy stcruy changed the title No readonly mode Readonly mode Feb 11, 2021
@stcruy
Copy link
Member

stcruy commented Feb 11, 2021

Thank you for acknowledging my work of writing solid documentation! That is really nice to hear! 😊

This 'readonly' feature is on the to-do list, indeed. But at the moment I have to prioritize more urgent tasks.

After developing the many core components of VSM, I'm now focusing for a while on demonstrating VSM's usefulness in many application areas. This will be essential to secure stable funding and to develop more nice-to-have features.

@stcruy
Copy link
Member

stcruy commented Feb 11, 2021

Here is a quick fix, perhaps: you could add a listener to your vsm-box, and when it emits a change event, just set the original initialValue back onto the vsm-box. That should make it clear to the user that you do not want them to use the editing function! A bit as in youtu.be/Nqk_nWAjBus. ^-^ (and check that the change doesn't echo back what you just put in!)

@carlosvega
Copy link
Author

For now I will be preventing the events of some parts with css pointer-events: none; but I wonder if there is any way to customize the contextual menu of the terms to remove the options remove/edit/insert . Thanks for the support!

@stcruy
Copy link
Member

stcruy commented Feb 19, 2021

Ha, that's a clever fix! : )
Could you add the list of CSS-overrides that work for you here, once you find them? It might help others.

For the contextual menus maybe the same approach does it... Have you tried setting display: none; on the .menu class (or some more specific selector) in ThePopup component?


Edit (Apr 2021): however, note that also in a readonly mode, the connector-highlighters should still appear when mousing over connectors. Because this helps users to see clearly which terms are connected by connectors that span longer distances.

@carlosvega
Copy link
Author

carlosvega commented Feb 19, 2021

Yes, that's my fallback solution :-) display:none for those options but I was hoping for a exclude list of the options. Fair enough. In the end I might go for pointer-events: none for the whole vsm-box since I can't avoid the user from double clicking the term box and show the input box. I will be losing the contextual menu because hover event won't be trigger but I couldn't find a better solution (i.e. disable connectors, double click and only keep the contextual menu).

As a mini-request, perhaps the vsm-box events should respond to preventDefault. This way developers could intercept all events and disable them one by one as needed.

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

No branches or pull requests

2 participants