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

Multiple instances? #140

Open
IntellectProductions opened this issue Apr 7, 2014 · 2 comments
Open

Multiple instances? #140

IntellectProductions opened this issue Apr 7, 2014 · 2 comments

Comments

@IntellectProductions
Copy link

So I viewed this issue:

#103

However, he didn't even post any code examples so I couldn't really understand what he meant by wrapper to begin with..

This is what I'm using:

<ul class="btn-toolbar" data-role="editor-toolbar" data-target=".description_text">
    <?php include_once('partial/wysiwyg-toolbar.php'); ?>
</ul>
<textarea name="description" class="description_text wysiwyg"></textarea>

Then I have another textarea on the same page:

<ul class="btn-toolbar" data-role="editor-toolbar" data-target=".short_description_text">
    <?php include_once('partial/wysiwyg-toolbar.php'); ?>
</ul>
<textarea name="description" class="short_description_text wysiwyg"></textarea> 

However, it still throws the typical multiple instance error:

Uncaught TypeError: Cannot read property 'ownerDocument' of undefined

@IntellectProductions
Copy link
Author

And setup like how it normally is just by adding a class to the textarea tag of wysiwyg, and in my universal js file, I have:

$('.wysiwyg').wysiwyg();

It works when there is only one textarea with that class, but as soon as I add a second one, it throws the above error. Granted, these text areas are loaded with ajax... but I also called the wysiwyg() method on ajaxStop().

@makusu
Copy link

makusu commented Apr 10, 2014

Hi @IntellectProductions

You might want to take a look on this #52

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