panelsnap icon indicating copy to clipboard operation
panelsnap copied to clipboard

Update Disable / Enable functions

Open Gaffen opened this issue 6 years ago • 2 comments

I have a use case where I'd like to disable and re-enable PanelSnap. As it stands the (undocumented) enable/disable functions work for this, however the library will continue to log to console as the events are still attached to the scroll container.

Would it be possible to add removing/re-adding the relevant events to the disable and enable methods?

Gaffen avatar Nov 05 '19 16:11 Gaffen

That's a good idea. Aside from the logging to the console, does the plugin do anything else you don't want it to? I'm wondering how this would work and what the actual use would be.

You are of course welcome to submit a PR. Otherwise I'll look into this when I have time.

guidobouman avatar Nov 06 '19 10:11 guidobouman

@guidobouman No, the plugin is fully functional for my use case as it is; so this is purely an enhancement.

The use case in question is that I have elements below the PanelSnap instance, which I want to be able to scroll to. I'm using an intersection observer to toggle the enabled/disabled status of PanelSnap as a result.

I will look into submitting a pull request when I get a moment!

Gaffen avatar Nov 07 '19 15:11 Gaffen