tiff / wysihtml5

Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.
http://xing.github.com/wysihtml5/
MIT License
6.5k stars 1k forks source link

Change callback not triggered when setting a color #518

Open Bloodsucker opened 9 years ago

Bloodsucker commented 9 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.