Skip to content

Commit

Permalink
Load shared filters js only when required
Browse files Browse the repository at this point in the history
  • Loading branch information
ncounter committed Dec 24, 2024
1 parent c7dedab commit 5ed8495
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/api/app/assets/config/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//= link webui/cm2/codemirror-file.js
//= link webui/cm2/codemirror-prjconf.js
//= link webui/cm2/codemirror-xml.js
//= link webui/filters.js
//= link_tree ../images


1 change: 0 additions & 1 deletion src/api/app/assets/javascripts/webui/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@
//= require webui/canned_responses.js
//= require webui/multi_select.js
//= require webui/dropdown.js
//= require webui/filters.js
4 changes: 2 additions & 2 deletions src/api/app/assets/javascripts/webui/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $(document).ready(function(){

$(document).on('change keyup', '#filter-form input, #filter-form select', function() {
highlightSelectedFilters();
$(window).clearTimeout(submitFiltersTimeout);
submitFiltersTimeout = $(window).setTimeout(submitFilters, 2000);
clearTimeout(submitFiltersTimeout);
submitFiltersTimeout = setTimeout(submitFilters, 2000);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@

.text-center.mt-4.mb-4
= link_to('Clear', token_workflow_runs_path(@token, []), class: 'btn btn-light border')

- content_for(:content_for_head, javascript_include_tag('webui/filters'))
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@
checked: selected_filter[:creators]&.include?(creator) }
.text-center.mt-4.mb-4
= link_to('Clear', url, class: 'btn btn-light border')

- content_for(:content_for_head, javascript_include_tag('webui/filters'))
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
.text-center.mt-4.mb-4
= link_to('Clear', my_notifications_path, class: 'btn btn-light border')

- content_for(:content_for_head, javascript_include_tag('webui/filters'))

:javascript
collectMultiSelects()

-# haml-lint:enable ViewLength

0 comments on commit 5ed8495

Please sign in to comment.