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

Events and cleanHTML aren't available #122

Open
floriansegginger opened this issue May 1, 2017 · 2 comments
Open

Events and cleanHTML aren't available #122

floriansegginger opened this issue May 1, 2017 · 2 comments

Comments

@floriansegginger
Copy link

Using the very example given in this repo

  $('#question-editor').wysiwyg().on('change', function () {
    // Do something
  });

Just spits out a jQuery error:

jquery.min.js:2 Uncaught TypeError: Cannot read property 'on' of undefined
    at HTMLDocument.<anonymous> (poll.js:26)
    at j (jquery.min.js:2)
    at k (jquery.min.js:2)

It seems the wysiwyg() function doesn't actually return anything anymore.

I would suggest updating the examples

@floriansegginger
Copy link
Author

Unless I'm mistaken, this seems like a more serious problem where this plug-in is basically unusable in its current form.

The Wysiwyg class is never exposed because it is in a self-calling function, and the jquery function doesn't return the newly created object. How can we do anything with this?

@floriansegginger floriansegginger changed the title Events don't work Events and cleanHTML aren't available May 1, 2017
floriansegginger added a commit to floriansegginger/bootstrap-wysiwyg that referenced this issue May 1, 2017
Return the jQuery element in wysiwyg function and expose cleanHtml as a jQuery function.
@spreadred
Copy link

@floriansegginger thanks, I've pushed this (minus the bower changes) to my fork!

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

No branches or pull requests

2 participants