Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the Drupal settings page for the Editor you have the possibility add and remove icons the way you want.
The problem is that the icons that are set as "default" in the javascript library ignore the settings coming from Drupal. Since the JS library automatically adds those set with default: true, value.
Witch creates some confusion since you can remove some icons and some not and often you don't want all of the default ones to be active.
Comment | File | Size | Author |
---|---|---|---|
#5 | remove_default_icons-2820307-5.patch | 743 bytes | kopin |
#2 | remove_default_icons-2820307-1.patch | 1.01 KB | kopin |
Comments
Comment #2
kopin CreditAttribution: kopin commentedI am now doing the same thing as for the selected icons, but I am filtering for the "Not selected" ones. Then i am passing them as an argument 'hideIcons' to the JS library, as specified in the library API.
I am not sure that this is the best way to do it but it seems to work nicely.
Patchfile attached
Comment #3
ademarco CreditAttribution: ademarco at Nuvole commentedThank you for your contribution! I'm ok with the approach (i.e. hiding those icons that are not selected). Please find below my review:
Could we use an anonymous function for callback instead? http://php.net/manual/en/functions.anonymous.php
Comment #4
ademarco CreditAttribution: ademarco at Nuvole commentedComment #5
kopin CreditAttribution: kopin commentedAdding patch with anonymous function
Comment #6
ademarco CreditAttribution: ademarco at Nuvole commented@Kopin you might want to actually always post the full patch containing all changes, like in this case remove_default_icons-2820307-5.patch should have contained remove_default_icons-2820307-1.patch for more info please check https://www.drupal.org/node/707484
I'll take care of merging them this time, so no need for extra work here, thanks! :)
Comment #8
ademarco CreditAttribution: ademarco at Nuvole commented