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

(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (+2 lines)
Lines 783-788 function _dt_add_filters(table_node, table_dt, filters_options = {}) { Link Here
783
783
784
    if (!$(table_node).length) return;
784
    if (!$(table_node).length) return;
785
785
786
    $(table_node).find('thead tr:eq(1) select').select2('destroy');
786
    $(table_node).find('thead tr:eq(1)').remove(); // Remove if one exists already
787
    $(table_node).find('thead tr:eq(1)').remove(); // Remove if one exists already
787
    $(table_node).find('thead tr').clone().appendTo( $(table_node).find('thead') );
788
    $(table_node).find('thead tr').clone().appendTo( $(table_node).find('thead') );
788
789
Lines 820-825 function _dt_add_filters(table_node, table_dt, filters_options = {}) { Link Here
820
                    o.appendTo(select);
821
                    o.appendTo(select);
821
                });
822
                });
822
                $(th).html( select );
823
                $(th).html( select );
824
                apply_select2(select);
823
            } else {
825
            } else {
824
                var title = $(th).text();
826
                var title = $(th).text();
825
                if ( existing_search ) {
827
                if ( existing_search ) {
(-)a/koha-tmpl/intranet-tmpl/prog/js/select2.js (-5 / +11 lines)
Lines 27-35 $.fn.select2.defaults.set("language", { Link Here
27
    removeItem:function(){return __("Remove item"); }
27
    removeItem:function(){return __("Remove item"); }
28
});
28
});
29
29
30
$(document).ready(function(){
30
function apply_select2(node){
31
    $(".select2").select2();
31
    $(node).select2();
32
    $(".select2").on("select2:clear", function () {
32
    $(node).on("select2:clear", function () {
33
        console.log("clear");
33
        $(this).on("select2:opening.cancelOpen", function (evt) {
34
        $(this).on("select2:opening.cancelOpen", function (evt) {
34
            evt.preventDefault();
35
            evt.preventDefault();
35
36
Lines 37-44 $(document).ready(function(){ Link Here
37
        });
38
        });
38
    });
39
    });
39
40
40
    $(document).on("select2:open", function () {
41
    /*$(document).on("select2:open", function () {
41
        document.querySelector(".select2-container--open .select2-search__field").focus();
42
        document.querySelector(".select2-container--open .select2-search__field").focus();
43
    });*/
44
}
45
46
$(document).ready(function(){
47
    $(".select2").each(function(){
48
        apply_select2(this);
42
    });
49
    });
43
});
50
});
44
51
45
- 

Return to bug 38310