djett41 / ionic-scroll-sista

An Ionic plugin that hides the header/tabs while scrolling
MIT License
125 stars 38 forks source link

ng-class not working #34

Open mopi1402 opened 8 years ago

mopi1402 commented 8 years ago

Your class is using an init() function to check if there is a header, subheader, ... In my case, I only want to show a subheader when I click on a button (to see a searchBar). By default, the subheader is not shown, and I have in my template a ng-class :

So, I just patched your directive with : $element.bind('scroll', function (e) { if (isNavBarTransitioning) { return; } init(); //added ... Now, it's working because the has-subheader is present on the ion-content before scrolling ;-) I'm not sure this is very proper to do like that, but it's working. So, fill free to use it... or not :) You other directive ionic-filter-bar is good, but I can use it because I have other filters button on my header.