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

Added Multiple Editors Instructions #1

Merged
merged 1 commit into from
Mar 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ Use standard jQuery methods to access and set content and focus. You can also as
$('#editor').cleanHtml()
```

Multiple Editors on the Same Page
-----------
You can initialize and use multiple instances of the editor on the same page, however, each editor specified in HTML must have a unique `data-role` specified.

For example:
```html
<div class="btn-toolbar editorToolbar" data-role="editor-toolbar_editor1" data-target...
```

Then initialize the editor in Javascript with the unique value assigned to the toolbar:
```javascript
$('#editor').wysiwyg({
toolbarSelector: '[data-role=editor-toolbar_editor1]'
});
```

Customising
-----------
You can assign commands to hotkeys and toolbar links. For a toolbar link, just put the execCommand command name into a data-edit attribute.
Expand Down