Automattic / Iris

A(n awesome) Color Picker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adding trigger to change

partnuz opened this issue · comments

//Color picker
( function( $ ){

$('.of-color').wpColorPicker({

    change: _.throttle( function( event , ui) { 
        console.log( ui.color.toRgb() );
        $(this).trigger( 'change' );
    }, 2000 )
});

})(jQuery);

When using the code above I can't add direct function with $(this).trigger( 'change' ); without use of _.throttle because it causes the script to stop working. Even when I use _.throttle and try to use ui firebug sometimes but not always shows that it doesn't exist. Is there a way to add trigger other than above ( note that when I set delay to anything under 2000 it causes incorrect behaviour )

Same issue. I'd like to see Iris automatically trigger the input.change() whenever you change color.

Why did you close it?