Skip to content

Commit

Permalink
ENH Show Search field if any keywords are presented
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Jul 7, 2022
1 parent ead33f0 commit c4e9ff1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions client/src/legacy/GridField.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ $.entwine('ss', function($) {
this.fixColumns();
this.injectSearchButton(false);
}

if (this.hasFilters()) {
this.injectSearchButton(true);
};

if (this.is('.grid-field--lazy-loadable') && (
(this.closest('.ss-tabset').length === 0) || (this.data('gridfield-lazy-load-state') === 'force') )
Expand Down Expand Up @@ -142,6 +146,16 @@ $.entwine('ss', function($) {
return JSON.parse(this.find(':input[name="' + this.data('name') + '[GridState]"]').val());
},

/**
* @returns {Boolean}
*/
hasFilters: function() {
if (this.getState().GridFieldFilterHeader) {
return true;
}
return false;
},

needsColumnFix: function() {
return (
this.find('.grid-field__filter-header, .grid-field__search-holder').length &&
Expand Down

0 comments on commit c4e9ff1

Please sign in to comment.