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

Support controls overlaid on selected nodes #132

Closed
marijnh opened this issue Jan 15, 2016 · 5 comments
Closed

Support controls overlaid on selected nodes #132

marijnh opened this issue Jan 15, 2016 · 5 comments

Comments

@marijnh
Copy link
Member

marijnh commented Jan 15, 2016

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.

@bZichett
Copy link
Contributor

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?

@marijnh
Copy link
Member Author

marijnh commented Jan 20, 2016

These would be node-specific controls, visible when selecting a node, rather than an always-present general menu.

@bZichett
Copy link
Contributor

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

@marijnh
Copy link
Member Author

marijnh commented Mar 14, 2016

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.

@marijnh
Copy link
Member Author

marijnh commented Dec 1, 2016

I think custom node views cover this pretty well.

@marijnh marijnh closed this as completed Dec 1, 2016
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