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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt (+1 lines)
Lines 432-437 Link Here
432
            $("#cancellation-reason").comboBox({
432
            $("#cancellation-reason").comboBox({
433
                displayProperty: 'name',
433
                displayProperty: 'name',
434
                placeholder: _("Select or type a reason"),
434
                placeholder: _("Select or type a reason"),
435
                context: 'modal',
435
            });
436
            });
436
437
437
        });
438
        });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 1250-1255 Link Here
1250
            $("#cancellation-reason").comboBox({
1250
            $("#cancellation-reason").comboBox({
1251
                displayProperty: 'name',
1251
                displayProperty: 'name',
1252
                placeholder: _("Select or type a reason"),
1252
                placeholder: _("Select or type a reason"),
1253
                context: 'modal',
1253
            });
1254
            });
1254
        });
1255
        });
1255
    </script>
1256
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 862-867 Link Here
862
            $("#cancellation-reason").comboBox({
862
            $("#cancellation-reason").comboBox({
863
                displayProperty: 'name',
863
                displayProperty: 'name',
864
                placeholder: _("Select or type a reason"),
864
                placeholder: _("Select or type a reason"),
865
                context: 'modal',
865
            });
866
            });
866
        });
867
        });
867
    </script>
868
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/combobox.js (-4 / +13 lines)
Lines 11-16 Link Here
11
     * @param {boolean} [config.useKeyAsValue=false] - Whether to use the option's key (either HTML data-* or JavaScript `valueProperty`) as the value of the input (default: false).
11
     * @param {boolean} [config.useKeyAsValue=false] - Whether to use the option's key (either HTML data-* or JavaScript `valueProperty`) as the value of the input (default: false).
12
     * @param {string} [config.placeholder='Select or type a value'] - Placeholder text for the input element.
12
     * @param {string} [config.placeholder='Select or type a value'] - Placeholder text for the input element.
13
     * @param {string} [config.labelId=''] - Optional ID of the associated label element.
13
     * @param {string} [config.labelId=''] - Optional ID of the associated label element.
14
     * @param {string} [config.context='default'] - Positioning context ('default' or 'modal').
14
     *
15
     *
15
     * @example
16
     * @example
16
     * ```html
17
     * ```html
Lines 35-43 Link Here
35
     *     displayProperty: 'name',
36
     *     displayProperty: 'name',
36
     *     valueProperty: 'id',
37
     *     valueProperty: 'id',
37
     *     useKeyAsValue: true,
38
     *     useKeyAsValue: true,
39
     *     context: 'modal',
38
     * });
40
     * });
39
     * // or using jQuery
41
     * // or using jQuery
40
     * $("#generic-combobox").comboBox({ ... });
42
     * $("#generic-combobox").comboBox({ displayProperty: 'name', context: 'modal' });
41
     * </script>
43
     * </script>
42
     * ```
44
     * ```
43
     */
45
     */
Lines 51-56 Link Here
51
            placeholder = "Select or type a value",
53
            placeholder = "Select or type a value",
52
            labelId = "",
54
            labelId = "",
53
            useKeyAsValue = false,
55
            useKeyAsValue = false,
56
            context = "default",
54
        } = config;
57
        } = config;
55
58
56
        const input = document.getElementById(inputId);
59
        const input = document.getElementById(inputId);
Lines 60-68 Link Here
60
            return;
63
            return;
61
        }
64
        }
62
65
63
        const bootstrapDropdown = new bootstrap.Dropdown(input, {
66
        const dropdownOptions = {
64
            autoClose: false,
67
            autoClose: false,
65
        });
68
            popperConfig: {
69
                strategy: { default: "absolute", modal: "fixed" }[context],
70
            },
71
        };
72
        const bootstrapDropdown = new bootstrap.Dropdown(
73
            input,
74
            dropdownOptions
75
        );
66
76
67
        // Existing options from HTML
77
        // Existing options from HTML
68
        const existingOptions = Array.from(dropdownMenu.querySelectorAll("li"))
78
        const existingOptions = Array.from(dropdownMenu.querySelectorAll("li"))
69
- 

Return to bug 40857