Cookie to remember the status of Block
When a page has many blocks and we minimize some it could remember the status and the next time we open it would stay minimized. Not sure if it's something that anyone else would use.
I've made a fork of this package and fixed this like this: https://github.com/adaptivemedia/nova-flexible-content/commit/2ff628a5a48a880f47a952b79c70529e6b548082 to use in a private package of ours.
Would be rather easy to make a PR of this but I'm afraid it wouldn't get merged since no PRs have been merged since april and this the maintainer of this package seems quite inactive...
@viirre that's a good solutions, thanks for sharing.
Using LocalStorage for this feature seems to be the right way to go, indeed. @viirre feel free to make a PR, since this is a simple one it will get merged in easily. Just remove the commented console.log statements and we're good to go.
If you have a minute, I would however prefer the following syntax for the mounted method since it will improve readability for future contributors :
mounted() {
if(this.isCollapsed()) this.collapse();
}
// ... methods :
isCollapsed() {
return (localStorage.getItem(this.getCollapsedKey()) === "true");
}
Thanks, and great idea !
Hmm, what happened to this PR?
This would be a really useful feature - it is very irritating to see all those sections reopen after each update. (Otherwise this is a really nice an useful lib, years ahead of Nova provided fields)
@piotrku I don't use this package anymore so pretty hard for me to test that this would still work with the latest version, but anymore can feel free to make a PR and submit it (you can find the code in my link above).