Browse Source

Add support for filters with multiple select

Denis K 8 years ago
parent
commit
4ae031d30c
1 changed files with 6 additions and 1 deletions
  1. 6 1
      jet/static/jet/js/src/layout-updaters/toolbar.js

+ 6 - 1
jet/static/jet/js/src/layout-updaters/toolbar.js

@@ -30,8 +30,13 @@ ToolbarUpdater.prototype = {
                 filterName = $element.text();
             } else if ($element.prop('tagName') == 'UL') {
                 var $select = $('<select>').addClass('changelist-filter-select');
+                var $items = $element.find('li');
 
-                $element.find('li').each(function(i) {
+                if ($items.filter('.selected').length > 1) {
+                    $select.attr('multiple', true);
+                }
+
+                $items.each(function(i) {
                     var $item = $(this);
                     var $link = $item.find('a');
                     var $option = $('<option>')