This change makes it possible to disable the "pan" behavior at runtime AFTER the slider has been loaded. Currently, the disablePan property is only checked during initial load. If it is changed after the Slider loads, it has no effect. With this change, setting disablePan to true at runtime will remove the pan event handler for the currentPanel.panel. If disablePan is set to true, the applySwipe method is called to re-init the pan gesture handler for the currentPanel.panel. This helps in cases where there are nested UI elements inside of a Slider trying to capture pan events. If disablePan is false in these cases, the pan events for nested UI elements can get swallowed by the Slider. Now a nested UI element can call disablePan = false during its own pan event, and then re-enable the Slider with disablePan = true when the pan event is complete.
This change makes it possible to disable the "pan" behavior at runtime AFTER the slider has been loaded. Currently, the
disablePan
property is only checked during initial load. If it is changed after the Slider loads, it has no effect. With this change, settingdisablePan
totrue
at runtime will remove thepan
event handler for thecurrentPanel.panel
. IfdisablePan
is set totrue
, theapplySwipe
method is called to re-init thepan
gesture handler for thecurrentPanel.panel
. This helps in cases where there are nested UI elements inside of a Slider trying to capturepan
events. IfdisablePan
isfalse
in these cases, thepan
events for nested UI elements can get swallowed by the Slider. Now a nested UI element can calldisablePan = false
during its ownpan
event, and then re-enable the Slider withdisablePan = true
when thepan
event is complete.