Closed Silver-Golden closed 2 years ago
6a16e88 is to pair with https://github.com/remotestorage/remotestorage.js/pull/1237 to preserve the local data when disconnected. Default behaviour remains unchanged
Thanks for your PR!
Just a heads-up: It will be difficult to merge the various different changes when they're all in one PR, but split up over a lot of commits. Cherry-picking self-contained commits is OK, but sorting through a lot of related ones is difficult and time-consuming. So it would be ideal if you could split up unrelated changes into separate pull requests. (git cherry-pick
is your friend for creating those branches from commits on master
in your own repo as well.)
One thing I was wondering is why you need to use JavaScript to detach the widget while not showing it, and then having it do all the init work again when you do. One easy solution to only showing the widget on specific pages/views is to use simple CSS for that. Consider this example from the Inspektor app, which only shows the widget when disconnected:
#remotestorage-widget {
display: none;
}
.connect #remotestorage-widget {
display: block;
}
That app is using a class name on the body
element, but you can also attach the widget to specific elements in your HTML for example (making it easier to use other selectors around it).
@Silver-Golden Did you see my replies by any chance?
Closing due to inactivity.
I am working on a react SPA and want to only show the widget when certain pages are rendered.
To do this I added a detach option to hide the widget when its not supposed to be visible.