jhollingworth / bootstrap-wysihtml5

Simple, beautiful wysiwyg editor
http://jhollingworth.github.com/bootstrap-wysihtml5/
MIT License
4.14k stars 1.01k forks source link

Change callback not triggered when setting a color #353

Open Bloodsucker opened 10 years ago

Bloodsucker commented 10 years ago

Hi all!

I have specified the change callback as follows:

    $textarea.wysihtml5({
        "stylesheets": ["[...........]/plugins/bootstrap-wysihtml5/wysiwyg-color.css"],
        "color": true,
        "events": {
            change: function () {
                var newValue = $textarea.val();
                console.log(newValue);
            },
            focus: function () {
                //Shows toolbar
            },
            load: function() {
                //Hides toolbar
            }

        }
    });

is not triggered in all situations. For example, when I set a text or mark a text selection as bold the callback is triggered. It is also triggered if I paste text into it. However, If I select a text and then I pick a colour to apply it does not trigger for some reason. The picked colour is applied but it is not reflected (it does not triggered by the change event) if I remove the focus (like it does in the previous described situations). It is just ignored.

Also does not trigger the event

"aftercommand:composer"

But it does when bolding a text, for example.

I'm using wysihtml5 v0.3.0 and a not specified version bootstrap-wysihtml5.

Thank you very much for your answers and your help.