Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes some code that previously forced an empty mobiledoc to
have a single empty section in it. A mobiledoc can now be truly empty and
the editor will display it and respond to events correctly.
Added
Post#isBlank
and in the keydown listener, if the post is blank theeditor will insert a new empty markup section under the cursor.
Now that it is possible to have a fully empty mobiledoc, the css for showing
the placeholder will apply again. We currently stop a "backspace" keystroke if
it is at the beginning of the first markup section, so it is not possible to use
the keyboard to make a post completely blank, but it's possible to do so by removing
a card from the editor if the card was the only thing there.
Updated the demo.js with a removable card demo and an empty mobiledoc demo
so that the two scenarios described above are viable to test and see the
placeholder text rendered.
Added some additional handling for the embed intent (the "+" icon that shows up)
to ensure that it does not throw errors and that it does show up when the
editor is showing an empty mobiledoc.
fixes #125 #35 #71