danielepiccone / ng-pageslide

AngularJS sliding panel for serving additional content from off the page
http://danielepiccone.github.io/ng-pageslide/examples/
451 stars 160 forks source link

Fixed issue where pageslider would animate on load in some cases #172

Closed cramatt closed 6 years ago

cramatt commented 7 years ago

Maybe related to #167 #154

cramatt commented 7 years ago

I noticed that in the demo, the pageslider works as expected. But in my app however, on some pages it behaves unexpected - what I see is the slider open, then animate closed.

I suspect this has something to do with angular running the digest cycle and maybe triggering animations?

Anyhow, what I've done is move the code that applies the transition into the start function. This way, the pageslider is positioned on page and no transitions effect its movements. Only once the user actually wants to move the slider does it animate.

I have not yet tested this with the slider defaulting to open - the examples when checked is set to false all break, even before this change.

danielepiccone commented 6 years ago

I have done a change in v2.2.0 which affects the initialization. Before, it would initialize as an open panel and then close once the digest would process scope.psOpen, the change makes the initialization function aware of the current open state and initialize the slider accordingly. That should address this problem as well, since the styles are applied in accordance with scope.psOpen from the start