Commit 4a7ab3e4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2442999 by idebr: Views dialog filter does not restripe

parent c4286466
Loading
Loading
Loading
Loading
+1 −1
Changes for core/modules/views_ui/css/views_ui.admin.theme.css: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -820,7 +820,7 @@ td.group-title {
  border-top:  1px solid #ccc;
}

.views-filterable-options .filterable-option:nth-of-type(even) .form-type-checkbox {
.views-filterable-options .filterable-option.odd .form-type-checkbox {
  background-color: #f3f4ee;
}

+11 −5
Changes for core/modules/views_ui/js/views-admin.js: 11 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -358,13 +358,16 @@
     * Keyup handler for the search box that hides or shows the relevant options.
     */
    handleKeyup: function (event) {
      var found, i, j, option, search, words, wordsLength;
      var found, i, j, option, zebraClass;

      // Determine the user's search query. The search text has been converted to
      // lowercase.
      search = this.$searchBox.val().toLowerCase();
      words = search.split(' ');
      wordsLength = words.length;
      var search = this.$searchBox.val().toLowerCase();
      var words = search.split(' ');
      var wordsLength = words.length;

      // Start the counter for restriping rows.
      var zebraCounter = 0;

      // Search through the search texts in the form for matching text.
      var length = this.options.length;
@@ -380,9 +383,12 @@
          }
        }
        if (found) {
          zebraClass = (zebraCounter % 2) ? 'odd' : 'even';
          // Show the checkbox row, and restripe it.
          option.$div.show();
          option.$div.removeClass('even odd');
          option.$div.addClass(zebraClass);
          option.$div.show();
          zebraCounter++;
        }
        else {
          // The search string wasn't found; hide this item.