File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 152152}
153153$addsamp - > click ( sub { newsamp ( '') - > click } ) ;
154154
155- our $re_debug = 0 ; #TODO Later : this is actually a parameter to update ( )
155+ # $re_debug is actually a parameter to update ( ) / actual_update ( ) , but since
156+ # we register & update as a event handler , it 'll get passed varying parameters
157+ our $re_debug = 0 ;
156158my $ta_debugout = $jq - > ( '#debugout' ) ;
157159my $re_debug_hide = $jq - > ( '#re_debug_hide' ) ;
158160$jq - > ( '#re_debug' ) - > click ( sub {
260262}
261263
262264sub update {
265+ state $timeout_id ;
266+ state $window = js ( 'window' ) ;
267+ $window - > clearTimeout ( $timeout_id ) if defined $timeout_id ;
268+ if ( $re_debug ) { $timeout_id= undef ; actual_update ( ) }
269+ else { $timeout_id = $window - > setTimeout ( \&actual_update , 100 ) }
270+ }
271+ sub actual_update {
263272 my $regex = $ta_regex - > val ;
264273 my $flags = $ta_flags - > val ;
265274 my $precode = $precode_ta - > is ( ':visible' ) ? $precode_ta - > val : '' ;
You can’t perform that action at this time.
0 commit comments