Problem/Motivation
We expose many class attributes in templates and other layers (for example preprocess), but it's never clear which classes are needed for JavaScript functionality, leaving themers in the dark if they want to slim down their markup and not break JS.
This is also being fixed in Drupal Core in #2431671: [meta] Add in js- prefixed classes for separation of JS & CSS functionality
Proposed resolution
Implement js- prefix for autocomplete to separate JavaScript behavior from styling as outlined in #2431671: [meta] Add in js- prefixed classes for separation of JS & CSS functionality
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
Linkit autocomplete textfields now implement a js-form-linkit-autocomplete class for to separate JavaScript behavior from styling.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3088314-8.patch | 2.73 KB | chewi3 |
| #4 | 3088314-4.patch | 3.42 KB | idebr |
Issue fork linkit-3088314
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
idebr commentedAttached patch implements a js-form-linkit-autocomplete class for to separate JavaScript behavior from styling. As a result, we can reuse the autocomplete styling available in Drupal Core in combination with the patch in #3088296: Implement js- prefix for autocomplete textfields to separate JavaScript behavior from styling. This becomes more visible when using Claro as the admin theme.
Comment #3
idebr commentedReroll after #2973181: Linkit does not autocomplete when crosslinking was committed.
Comment #4
idebr commentedReroll against latest 6.0.x after #3288339: Drupal 10 compatibility was committed.
Comment #5
mark_fullmerComment #7
nils.destoop commentedPatch is not apply-ing anymore, and also breaks the linkit styling when using the ckeditor link widget.
Comment #8
chewi3 commentedRerolled the last patch for 7.0.7.
Comment #9
idebr commentedThe autocomplete icon in the CKEditor widget cannot be updated with this approach without duplicating css, so the approach in #3472411: Match autocomplete icon to Claro autocomplete is preferable