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 disableEditing, enableEditing #82

Merged
merged 1 commit into from
Aug 24, 2015
Merged

Conversation

mixonic
Copy link
Contributor

@mixonic mixonic commented Aug 17, 2015

Per the 0.4.0 epic, we would like an API for disabling the ability for a user to enter and edit existing text. This is useful in conjunction with the programmatic API- It allows us to build editing interfaces that output mobiledoc and cards, but without needing to allow freeform content.

The APIs are:

  • editor.disableEditing() - stop the user from being able to edit the
    current post with their cursor. Programmatic edits are still allowed.
  • editor.enableEditing() - allow the user to make direct edits directly
    to a post's text.

@mixonic mixonic mentioned this pull request Aug 17, 2015
10 tasks
@mixonic
Copy link
Contributor Author

mixonic commented Aug 18, 2015

@bantic could use a review here!

@@ -167,6 +167,20 @@ test('hitting enter at end of a section creates new empty section', (assert) =>
offset: 0});
});

Helpers.skipInPhantom('deleting across 0 sections does nothing if editing is disabled', (assert) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be safe to run in phantom, and should say "delete across 2 sections"

@bantic
Copy link
Collaborator

bantic commented Aug 19, 2015

@mixonic 👍 I had a small comment on one of the tests. It would be nice if there were a single bottleneck that event listeners ran through — that way there'd only be a single point where you would ignore events — like a handle(Xevent), but that's a separate concern. This looks good

@mixonic mixonic force-pushed the disable-editing branch 2 times, most recently from 6b78e81 to 931e868 Compare August 24, 2015 15:10
@mixonic
Copy link
Contributor Author

mixonic commented Aug 24, 2015

Phantom does not respect toggling contenteditable off :-/ Left the skip in with a comment. Confirmed to pass locally.

mixonic added a commit that referenced this pull request Aug 24, 2015
Add disableEditing, enableEditing
@mixonic mixonic merged commit 1aeb450 into bustle:master Aug 24, 2015
@mixonic mixonic deleted the disable-editing branch August 24, 2015 15:27
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

Successfully merging this pull request may close these issues.

None yet

2 participants