Readmore.js
Readmore.js copied to clipboard
Version 3.0 ToDos
https://github.com/jedfoster/Readmore.js/tree/version-3.0
- [ ] Tests?
- [ ] Examples
- [ ] Vanilla
- [ ] jQuery (latest)
- [ ] React
- [ ] Riot
- [ ] Vue.js
- [ ] Angular
- [ ] Next.js
- [x] Validate package structure against...
- [x] Yarn
- [x] Rollup
- [x] Babel
- [x] Webpack
- [x] Browser (
<script src="/node_modules/readmore-js/dist/readmore.js"></script>
)
- [x] Investigate need for CSS prefixes on supported browsers (do we need
-moz
, et al?) - [x] Document new/changed APIs
- [x] Evaluate #132 for adoption/inclusion. (Feature for controlling where toggle link is inserted—before/after block)
- [x] Evaluate #140 for adoption/inclusion. (Stop expanding content if beforeToggle returns false)
- [x] Evaluate #207 for adoption/inclusion. (Allow moreLink and lessLink options to use callbacks)
- [x] Fill in
destroy()
method - [x] Refactor
toggle()
andconstructor()
to work withquerySelectorAll
- [x] Update README on
master
branch - [x] Evaluate #224 for adoption/inclusion
- [x] Evaluate #225 for adoption/inclusion
- [x] ~~Refactor
toggle()
to expose as a static method~~ Not sure of the utility of this;toggle
depends onoptions
which is an instance property.
Re: tests,
Puppeteer looks promising. Decent tutorial on using it with Mocha: https://medium.com/@ankit_m/ui-testing-with-puppeteer-and-mocha-part-1-getting-started-b141b2f9e21
transition
is the only CSS property that would conceivably need to be prefixed, but http://shouldiprefix.com/#transitions says "No prefixes!" So, 🎉
Great work on this @jedfoster. Been trying to integrate with a web component, but it doesn't seem to be fully working when using within shadowDom.
The general functionality works, but the use of document.querySelector causes a few problems...
The moreLink, for example, doesn't get replaced with lessLink on toggle.
Have you had any thoughts on supporting this being used within shadowDom?
@olivercastle No, I hadn't even thought of using this in a web component, but that's a fantastic idea. Unfortunately, I have zero experience with that technology, and don't have any idea how to start.
Pull requests are always welcome.