vsymguysung / ember-cli-summernote

ember cli addon for summernote
MIT License
31 stars 22 forks source link

Added functionality to make read-only by setting "disabled" variable on the component #4

Closed hchokshi closed 9 years ago

hchokshi commented 9 years ago

I have added functionality to make the input read-only, by setting the disabled variable. The disabling is accomplished by modifying contenteditable on the Summernote editor div.

Obviously, disabled=false by default, so any existing code will work fine without any changes.

To try out the disable functionality, run the example. The checkbox under the editor controls read-only mode.


Example use case:

User is drafting a post and editing isn't allowed after it has been published. You can bind the post editor using the following:

{{summer-note height=200 btnSize=bs-sm content=model.postText focus=false header="Example" disabled=model.isPublished}}
vsymguysung commented 9 years ago

It looks good to have this option. Thanks for your contribution.