-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution to get it worked when used inside a directive #14
Comments
Hi, have you try to rebuild the scrollbar whenever the content is changed ? |
Tried to put the ng-scrollbar in a directive. But id does not work. I called "rebuilt" it but no luck. |
@arvind07 take a look at this simple example - http://plnkr.co/45EoWm |
@paranoicsan Thanks :) |
@paranoicsan I got the problem now. It fails in the case where the height of "div" is not specified in advance. See this plunker- http://plnkr.co/edit/h6E7ViZQ9Yr7kbmuARHb |
I tried to implement with ng-repeat it is not working. it is working only with static content. Help me to implemnt with dynamic content with ng-repeat. |
I've tried to use ng-scollbar inside a directive that needs to dynamically adjusts the height of scrollable content on demand.
And it does not works.
After a litte dig up in the code, I've seen that page.height is not calculated correctly in the buildScrollbar funcions:
page.height = element[0].offsetHeight - parentOffsetTop;
To solve this issues I've added a scope variable height, read from attributes height:
...
scope.height = attrs.height;
buildScrollbar()
...
And changed the line above this way:
page.height = (scope.height > 0) ? scope.height : (element[0].offsetHeight - parentOffsetTop);
So in the html I can set up the height of my scrollable area:
Hope this helps.
The text was updated successfully, but these errors were encountered: