Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite front js in vanilla - Fix #121 #162

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

corentin-gautier
Copy link

@corentin-gautier corentin-gautier commented Jul 31, 2022

Hi @philbuchanan !

Thanks for this plugin ! I've been using it on a couple of projects already, however the dependency to jquery is kind of a deal breaker ... so I took the liberty to rewrite the js into vanilla !

I hope you'll be able to test this and merge if everything's ok 🎉

Rewrite front js in vanilla - Fix #121
add alignment support - Fix #103

accordion-blocks.min.js is now 1.8kB instead of 1.3kB (gzipped) but this removes ~37kB of jquery dependencies 🎉 .

EDIT :

@corentin-gautier
Copy link
Author

This PR also adds a new behaviour : accordion items are now grouped by the fact that they are adjacent to each other, not just by being children of the same parent

add alignment support - Fix philbuchanan#103

use hidden until-found - Fix philbuchanan#161

Remove the use of children - Maybe Fix philbuchanan#117

add resize event dispatch - Fix philbuchanan#59

revert removal of the button option

use <accordion-item> custom element
add js documentation
requestIdleCallback before window scroll

remove use of "window."
@corentin-gautier
Copy link
Author

Fixing #29 could be has simple has :

document.querySelectorAll('accordion-item').forEach(i => i.open({noChecksAndScroll: true, noAnim: true}))

I don't know how we could go about adding a button though (maybe another block ?)

@corentin-gautier
Copy link
Author

corentin-gautier commented Aug 1, 2022

Changed the allowedFormats handling : only disallow core/link to allow other formats (adds the ability to add inline images, colors, etc. and most importantly every other plugin defined formats)

Fix: #173

Screenshot 2022-08-01 at 10 28 55

@corentin-gautier
Copy link
Author

@philbuchanan hi ! Are you still maintaining this repo ?

@philbuchanan
Copy link
Owner

I am maintaining this plugin for my own purposes, but am not actively developing it any more. I just don't have the time and financially it doesn't make sense for me to devote more time to it.

This particular PR is too far reaching for me to fully test and merge into the main plugin. I like the idea of removing the jQuery dependency, but this PR does far more than that. I would suggest forking the plugin and making changes to suit your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment