Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Multiple Editors on one page #186

Closed
ayyobro opened this issue Feb 26, 2015 · 2 comments
Closed

Multiple Editors on one page #186

ayyobro opened this issue Feb 26, 2015 · 2 comments

Comments

@ayyobro
Copy link

ayyobro commented Feb 26, 2015

Each editor has a data-target specific to the editor div (by id), but whenever I edit one, like add a bullet point, it adds the bullet point to all of them.

So, for instance

<div class="btn-toolbar" data-role="editor-toolbar" data-target="#editor1">
    <div class="btn-group">
        <a class="btn btn-default" data-edit="bold" data-original-title="Bold (Ctrl/Cmd+B)" title="Bold"><i class="fa fa-bold"></i></a>
        <a class="btn btn-default" data-edit="italic" data-original-title="Italic (Ctrl/Cmd+I)" title="Italic"><i class="fa fa-italic"></i></i></a>
        <a class="btn btn-default" data-edit="underline" data-original-title="Underline (Ctrl/Cmd+U)" title="Underline"><i class="fa fa-underline"></i></i></a>
    </div>
</div>
<div id="editor1"></div>
<textarea class="form-control body-description hidden" id="hidden-editor" name="description"></textarea> <!-- editor html goes into here via jQuery, works great -->
    $('#editor1').wysiwyg();

Then I have a second instance, all the same stuff, except the id is editor2 instead of editor1, then editor3, editor4, etc... but all of them seem to target eachother regardless of whatever I set the data target to?

Help?

@Crenshinibon
Copy link

I do additionally bind the editor on instantiating to the corresponding toolbar, like:

$('#editor1').wysiwyg({ toolbarSelector: "#toolbar1" });

Taken, you give your toolbar the id "toolbar1"

Hope that helps.

Regards
Dirk

@ayyobro
Copy link
Author

ayyobro commented Feb 26, 2015

Thanks! That fixed her right up. Appreciate it

@ayyobro ayyobro closed this as completed Feb 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants