View | Details | Raw Unified | Return to bug 35396
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (-13 / +19 lines)
Lines 911-927 function _dt_add_filters(table_node, table_dt, filters_options = {}) { Link Here
911
                }
911
                }
912
            }
912
            }
913
913
914
            var search = $.fn.dataTable.util.throttle( function ( i, val ) {
914
            function delay(callback, ms) {
915
                table_dt
915
                var timer = 0;
916
                    .column( i )
916
                return function () {
917
                    .search( val )
917
                    var context = this, args = arguments;
918
                    .draw();
918
                    clearTimeout(timer);
919
            }, 500);
919
                    timer = setTimeout(function () {
920
920
                        callback.apply(context, args);
921
            $( input_type, this ).on( 'keyup change', function () {
921
                    }, ms || 0);
922
                if ( table_dt.column(i).search() !== this.value ) {
922
                };
923
                    if ( input_type == "input" ) {
923
            }
924
                        search(i, this.value)
924
925
            $(input_type, this).on('keyup change', (delay(function () {
926
                if (table_dt.column(i).search() !== this.value) {
927
                    if (input_type == "input") {
928
                        table_dt
929
                            .column(i)
930
                            .search(this.value)
931
                            .draw();
925
                    } else {
932
                    } else {
926
                        table_dt
933
                        table_dt
927
                            .column(i)
934
                            .column(i)
Lines 929-935 function _dt_add_filters(table_node, table_dt, filters_options = {}) { Link Here
929
                            .draw();
936
                            .draw();
930
                    }
937
                    }
931
                }
938
                }
932
            } );
939
            }, 500)));
933
        } else {
940
        } else {
934
            $(this).html('');
941
            $(this).html('');
935
        }
942
        }
936
- 

Return to bug 35396