steveathon / bootstrap-wysiwyg

Tiny bootstrap-compatible WYSIWYG rich text editor
MIT License
661 stars 1.71k forks source link

Events and cleanHTML aren't available #122

Open floriansegginger opened 7 years ago

floriansegginger commented 7 years ago

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 commented 7 years ago

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?

spreadred commented 7 years ago

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