summaryrefslogtreecommitdiffstats
path: root/static/chosen/chosen.jquery_ready.js
blob: 65308b8dbe80bdfa6d9f97e65d5bc66603886bdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(function ($) {
    $(function () {
        $(".chzn-select").each(function(i, select) {
            var $select = $(select);

            // Set overflow:visible on parent .form-row for django admin
            $select.parents('.form-row').css('overflow', 'visible');

            if (typeof grappelli == 'object') {
                // Set overflow:visible on grappelli fieldset.module .row
                $select.parents('.row').filter(function(i) {
                    return $(this).parent('fieldset.module').length;
                }).css('overflow', 'visible');
                // Set overflow:visible on grappelli tabular module
                $select.parents('td').filter(function(i) {
                    return $(this).parent('.module.table').length;
                }).css('overflow', 'visible');
            }

            // Initialize Chosen
            $select.chosen();
        });
    });
})((typeof window.django != 'undefined') ? django.jQuery : jQuery);