Fixed checkboxes not being recognized in search input
authorAlexander Ebert <ebert@woltlab.com>
Tue, 11 Jun 2013 14:31:49 +0000 (16:31 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 11 Jun 2013 14:31:49 +0000 (16:31 +0200)
wcfsetup/install/files/js/WCF.Search.Message.js

index ea05a2d206c31810414ba617e23119b126c0ed90..5fd491938b43dde2aef6874ad4ef96382100acff 100644 (file)
@@ -114,6 +114,19 @@ WCF.Search.Message.SearchArea = Class.extend({
                                return false;
                        }
                });
+               
+               if (this._searchArea.hasClass('dropdown')) {
+                       var $containerID = this._searchArea.wcfIdentify();
+                       var $form = this._searchArea.find('form').submit(function() {
+                               var $dropdownMenu = WCF.Dropdown.getDropdownMenu($containerID);
+                               
+                               $dropdownMenu.find('input[type=checkbox]:checked').each(function(index, input) {
+                                       var $input = $(input);
+                                       
+                                       $('<input type="checkbox" name="' + $input.attr('name') + '" value="' + $input.attr('value') + '" checked="checked" />').appendTo($form);
+                               });
+                       });
+               }
        },
        
        _callback: function(data) {