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

✨ Add insertParagraph buttons #67

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

✨ Add insertParagraph buttons #67

wants to merge 3 commits into from

Conversation

micgro42
Copy link
Contributor

Exemplary implementation of the insertParagraph buttons.

The buttons need access to the current view to execute the command. Due to javascript scoping rules we have to provide a function to get the view when we need it instead of a reference to the view itself.

Also, strange things are happening if we create the buttons right in the schema node where we need them. Thus creating them in a local variable and adding them when needed.

@annda, @JayDeeDee Please especially point out any places where you'd feel that more comments would be helpful in the future.

ToDo:

  • decide where we actually want to use them
  • styling

Exemplary implementation of the insertParagraph buttons.

The buttons need access to the current view to execute the command. Due
to javascript scoping rules we have to provide a function to get the view when
we need it instead of a reference to the view itself.

Also, strange things are happening if we create the buttons right in the
element where we need them. Thus creating them in a local variable and
adding them when needed.

ToDo:
* decide where we actually want to use them
* styling
@micgro42 micgro42 changed the title ✨ Add insertParagraph buttons for html_block ✨ Add insertParagraph buttons Oct 16, 2018
Why didn't they show up during `yarn watch` ? o.O
The previous implementation was flawed beyond repair, because there was
only ever a single instance of the buttons. They were in effect only
attached to the very last element of those which were supposed to have
them.

This new implementation lets ProseMirror create the buttons and executes
the event based on their class and get's the view from the global
ProseMirror field.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Roadmap
  
To do
Development

Successfully merging this pull request may close these issues.

None yet

2 participants