-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
Support controls overlaid on selected nodes #132
Comments
I like this idea. I think something close to it's purpose was implemented a few months back but decided against and removed by you (Correct me if I'm wrong!) where there was an option to show a context menu floated to the right of the currently selected block/node (that is, where the caret is located) . I thought this solution was pretty great. For example, I'd surmise that the context options would be customized with image resizing functions (and other) functions when selecting an Image Block. As per this new request, it seems the only difference is in the positioning of the "overlay"? Or am I missing some crucial difference between that past solution? |
These would be node-specific controls, visible when selecting a node, rather than an always-present general menu. |
Updated my previous comment with corrections / more information (didn't think you'd answer that quick) In that past solution, it wasn't always present. At least it was only always present if your caret was somewhere in the confines of a text block, and that "right-aligned floated context menu" acted on that text block only (maybe it didn't?) Perhaps this is clearer, since I wasn't referring to the general menu |
We'll want to formulate this as a more general 'node decoration' feature -- there a bunch of use cases that require the ability to override the way a given node is rendered (selected nodes, widgets, ad-hoc styling), and they'll all need to somehow interface with the update algorithm, so it would be good to solve that with a single feature, rather than a bunch of separate hacks. |
I think custom node views cover this pretty well. |
For example, it'd be nice for nodes like images to have a little control to change its attributes when you select it.
Main difficulty is one of CSS -- if I overlay these over the document, they'll get mispositioned when content changes. If I want to put them inside the nodes, I can't do that for inline nodes (which can't be relatively positioned) and would have to add ugly hacks like extra inline-block nodes).
It may even be nice to support overlay controls on all nodes, not just selected ones. If you're showing say, a video node, an always-present little edit icon in a corner would be easy to discover and use.
The text was updated successfully, but these errors were encountered: