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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-8 / +8 lines)
Lines 611-616 Link Here
611
                    ],
611
                    ],
612
                    pagingType: "full_numbers",
612
                    pagingType: "full_numbers",
613
                });
613
                });
614
                let table_dt = table.DataTable();
614
615
615
                $("#del_form").on("click", ".delete_news", function(e){
616
                $("#del_form").on("click", ".delete_news", function(e){
616
                    e.preventDefault();
617
                    e.preventDefault();
Lines 631-662 Link Here
631
632
632
                $("#show_expired").on("change", function(){
633
                $("#show_expired").on("change", function(){
633
                    /* redraw the DataTable according to the custom search function */
634
                    /* redraw the DataTable according to the custom search function */
634
                    table.draw();
635
                    table_dt.draw();
635
                });
636
                });
636
637
637
                table.on( 'search.dt', function () {
638
                table_dt.on( 'search.dt', function () {
638
                    var term = table.search();
639
                    var term = table_dt.search();
639
                    $("#news_keyword").val( term );
640
                    $("#news_keyword").val( term );
640
                });
641
                });
641
642
642
                $("#news_keyword").on("keyup", function(){
643
                $("#news_keyword").on("keyup", function(){
643
                    var term = $(this).val();
644
                    var term = $(this).val();
644
                    filterDataTable( table, null, term );
645
                    filterDataTable( table_dt, null, term );
645
                });
646
                });
646
647
647
                $("#news_display_location").on("change", function(){
648
                $("#news_display_location").on("change", function(){
648
                    var term = $(this).val();
649
                    var term = $(this).val();
649
                    filterDataTable( table, 1, term );
650
                    filterDataTable( table_dt, 1, term );
650
                });
651
                });
651
652
652
                $("#news_library").on("change", function(){
653
                $("#news_library").on("change", function(){
653
                    // Table must be filtered by the <option>'s text, not its value
654
                    // Table must be filtered by the <option>'s text, not its value
654
                    var opt = $(this).find("option:selected").text();
655
                    var opt = $(this).find("option:selected").text();
655
                    filterDataTable( table, 2, opt );
656
                    filterDataTable( table_dt, 2, opt );
656
                });
657
                });
657
658
658
                $(".dt_button_clear_filter").on("click", function(){
659
                $(".dt_button_clear_filter").on("click", function(){
659
                    table.search('').columns().search('').draw();
660
                    table_dt.search('').columns().search('').draw();
660
                    $("#news-filter select").each(function(){
661
                    $("#news-filter select").each(function(){
661
                        $(this).val("");
662
                        $(this).val("");
662
                    });
663
                    });
663
- 

Return to bug 38255