codeconsole commented on code in PR #15987:
URL: https://github.com/apache/grails-core/pull/15987#discussion_r3596548392
##########
dependencies.gradle:
##########
@@ -35,7 +35,7 @@ ext {
'javaparser-core.version' : '3.28.2',
'jline.version' : '3.30.6',
'jna.version' : '5.19.1',
- 'jquery.version' : '3.7.1',
+ 'jquery.version' : '4.0.0',
Review Comment:
Added as section 35 in `upgrading80x.adoc` — the major bump and the removed
utilities, a link to the jQuery 4.0 upgrade guide, and the pin-back for apps
that aren't ready to migrate.
One adjustment to the suggested workaround: a plain `implementation
'org.webjars.npm:jquery:3.7.1'` doesn't actually downgrade, because the
auto-applied Grails BOM is a non-enforced `platform()` and its 4.0.0 wins under
Gradle's highest-version-wins resolution. The note recommends the BOM property
override `jquery.version=3.7.1` instead, which is applied as a strict
constraint that correctly downgrades (consistent with section 14). ea78cf8
##########
grails-profiles/web/skeleton/grails-app/assets/javascripts/application.js:
##########
@@ -17,4 +17,40 @@ if (typeof jQuery !== 'undefined') {
$(this).fadeOut();
});
})(jQuery);
-}
\ No newline at end of file
+}
Review Comment:
Good catch. Fixed rather than deleted, since `#spinner` is present in the
layout — rebound the global `ajaxStart`/`ajaxStop` handlers to `document` (your
suggested form) so the spinner actually shows. Applied to both the Forge and
profile copies. 0e28a4d
##########
grails-profiles/web/skeleton/grails-app/assets/javascripts/application.js:
##########
@@ -17,4 +17,40 @@ if (typeof jQuery !== 'undefined') {
$(this).fadeOut();
});
})(jQuery);
-}
\ No newline at end of file
+}
+
+// Navbar Controllers filter — rendered only when the list is long enough to
warrant
+// it (see the threshold in the layout). Filters the menu's [data-name]
entries in place.
+(function () {
+ function applyNavFilter(input) {
+ const scope =
document.querySelector(input.getAttribute('data-filter-scope') || '');
+ if (!scope) return;
+
+ const query = input.value.trim().toLowerCase();
+ let visible = 0;
+ scope.querySelectorAll('[data-name]').forEach((el) => {
+ const show = !query || (el.getAttribute('data-name') ||
'').toLowerCase().includes(query);
+ el.classList.toggle('d-none', !show);
+ if (show) visible++;
+ });
+
+ const empty = scope.querySelector('.nav-filter-empty');
+ if (empty) empty.classList.toggle('d-none', visible > 0);
+ }
+
+ document.addEventListener('DOMContentLoaded', () => {
+ document.querySelectorAll('.nav-filter-input').forEach((input) => {
+ input.addEventListener('input', () => applyNavFilter(input));
+ input.addEventListener('search', () => applyNavFilter(input));
+
+ const dropdown = input.closest('.dropdown');
+ if (!dropdown) return;
+ // Focus the field as the menu opens; clear it once the menu
closes.
+ dropdown.addEventListener('shown.bs.dropdown', () =>
input.focus());
Review Comment:
Gated the on-open autofocus to `window.matchMedia('(hover: hover)').matches`
in both copies, so touch devices no longer pop the on-screen keyboard over the
list. 0e28a4d
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]