bootstrap-toc icon indicating copy to clipboard operation
bootstrap-toc copied to clipboard

drop jQuery dependency

Open BoPeng opened this issue 3 years ago • 5 comments

bootstrap5 beta is out and the biggest change would be the drop of jquery dependency.

I just briefly tested bootstrap-toc on my website and it appears to be working properly as long as I load bootstrap5 and jquery. I am not quite sure if it is worthwhile to stop using jquery in bootstrap-toc but it would be nice if someone tries to tackle it.

BoPeng avatar Jan 05 '21 17:01 BoPeng

Ah, good to know. https://github.com/afeld/bootstrap-toc/issues/16 would probably be a good way to future-proof against that problem.

afeld avatar Jan 05 '21 20:01 afeld

Would love some help on that if interested!

afeld avatar Jan 05 '21 20:01 afeld

Had a look at #16. My "working properly" might be wrong since scrollspy might not be working properly. Anyway, I think dropping dependency on jquery is more important than dropping dependency on bootstrap.

BoPeng avatar Jan 05 '21 21:01 BoPeng

Got it. Re-titled to reflect that. Seems very doable, though not sure when I will get to it. Pull request welcome!

afeld avatar Jan 05 '21 22:01 afeld

Hey,

I started working on this feature, I was almost done when I noticed that I made a mistake. The $scope option can contain more than one element in this library, but my implementation assumes that it's a single element.

I'm pretty tired now to fix it (and I don't know if/when I'll want to continue it), but I'll link my fork so you can maybe take it and improve it, and hopefully finish this transition.

https://github.com/Pustur/bootstrap-toc/tree/remove-jquery

I'm available if you have any questions.

PS: Commits are pretty messy, but I left them separated to better show the steps I took.

Pustur avatar Jan 08 '21 21:01 Pustur