You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a lot of content and little space the dragger can become too small. I have solved it, but can't submit a pull request because I have also made some other alterations to your code that might only be useful in my current project.
So the solution:
in the HTML you can add something like this: <div class="scroll-area" ng-scrollbar min-height="30">
Then in the part where you define the flags object, around line 18:
varflags={bottom: attrs.hasOwnProperty('bottom'),// I've used 6px as a default minHeightminHeight: attrs.minHeight ? parseInt(attrs.minHeight) : 6,};
And in the part where you set the dragger.height, around line 177:
// Calculate the dragger heightvarvirtualDraggerHeight=Math.round(page.height/page.scrollHeight*page.height);dragger.height=virtualDraggerHeight<flags.minHeight ? flags.minHeight : virtualDraggerHeight;
I posted some suggestions earlier today that might be a bit specific to my current project, but I think the suggestion above is pretty beneficial in general.
UPDATE:
After some more testing I realised that my solution posted above was not complete yet. It also requires some refinement to the redraw function. The current algorithm does not take the dragger.height into account. You start to really notice this when there is a lot of content and the dragger is kept larger by the fixes above. However, this is just a general flaw in the function. Please see an updated version below:
If you have a lot of content and little space the dragger can become too small. I have solved it, but can't submit a pull request because I have also made some other alterations to your code that might only be useful in my current project.
So the solution:
in the HTML you can add something like this:
<div class="scroll-area" ng-scrollbar min-height="30">
Then in the part where you define the flags object, around line 18:
And in the part where you set the
dragger.height
, around line 177:I posted some suggestions earlier today that might be a bit specific to my current project, but I think the suggestion above is pretty beneficial in general.
UPDATE:
After some more testing I realised that my solution posted above was not complete yet. It also requires some refinement to the redraw function. The current algorithm does not take the dragger.height into account. You start to really notice this when there is a lot of content and the dragger is kept larger by the fixes above. However, this is just a general flaw in the function. Please see an updated version below:
I haven't done any rigorous tests, but my first impressions are that it is now pixel perfect.
Thanks,
Hendrik
The text was updated successfully, but these errors were encountered: