Problem/Motivation
Drupal.Ajax.prototype.setProgressIndicatorBar
adds some additional classes to the progress bar component. Currently it isn't possible to override the classes without duplicating all of the logic inside the function in a theme.
Proposed resolution
Instead of adding classes directly to the existing element, wrap the progress bar with additional div which gets generated by a theme function.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Ajax progress bar added some hardcoded classes to progress bar that couldn't be overridden by themes. The markup is now generated by a new theme function Drupal.theme.ajaxProgressBar, and as a result, classes have been moved to a new wrapping element. The classes are moved to a new wrapping div only on Stable or Classy. The theme function can be overridden by all themes.
Comment | File | Size | Author |
---|---|---|---|
#16 | core-ajax_progress_bar_classes_to_theme-3059847-16.patch | 4.85 KB | huzooka |
#7 | interdiff.txt | 432 bytes | lauriii |
#7 | 3059847-7.patch | 4.06 KB | lauriii |
#5 | interdiff.txt | 2.47 KB | lauriii |
#5 | 3059847-5.patch | 3.55 KB | lauriii |
Comments
Comment #2
volkerk CreditAttribution: volkerk at Thunder commentedAdded a theme function wrapping the progress bar element.
There is a PR for the cd_tools module to facilitate the new theme function in claro testing
https://github.com/zolhorvath/cd_tools/pull/1.
Comment #3
volkerk CreditAttribution: volkerk at Thunder commentedRe-rolled adding missing core dir.
Comment #4
quironI reviewed and tested and LGTM
Comment #5
lauriiiI added backwards compatibility layer for this in Stable.
Comment #7
lauriiiAdded the compiled JS to the patch.
Comment #8
quironTested and works as expected: adds a new wrapper with classes
ajax-progress ajax-progress-bar
unless stable is loaded, then it keeps working with the previous behavior adding the classes to the already existing div with classprogress
.Comment #9
alexpott@lauriii are we worrying at all about the BC implications of making this change? What if anything are existing themes going to have to do - especially if they don't extend stable (eg bootstrap).
I think we need a change record here too.
Comment #10
lauriiiCreated two change records. One for the addition of the new theme function and one for the markup change. I also tested bootstrap to make sure this doesn't break anything and can confirm that they are not relying on anything related to these classes.
Comment #11
larowlanCan we get a release notes snippet added to the issue summary for this one, thanks.
Comment #12
lauriiiCreated a release note snippet.
Comment #13
lauriiiComment #14
Wim LeersOoohhhhhhhhh, this is super clever! I'm impressed 👏🤓
Comment #15
huzookaComment #16
huzookaRe-rolled #7.
Eslint reports errors even when it is runned with the "passing" rules.
I fixed them only for the files that are affected by this patch.
Comment #17
Wim Leers✔️ These changes are out-of-scope, @huzooka did those to fix eslint errors. That's fine IMHO.
🤓 Übernit that can be fixed on commit:
Ajax-related
Comment #18
alexpottCommitted bb3791d and pushed to 8.8.x. Thanks!