Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scrollable.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
$nanoElement = element.hasClass(nanoClass) ? element : element.find('.' + nanoClass),
options = angular.extend({}, nanoScrollerDefaults, convertStringToValue(attr), scope.$eval(attr['scrollable']));

//Bindings for scrollend and scrolltop events
if(attr.scrollend) element.bind('scrollend', function () { scope.$apply(attr.scrollend); });
if(attr.scrolltop) element.bind('scrolltop', function () { scope.$apply(attr.scrolltop); });

function listener(newHeight, oldHeight) {
// If this is first run, create nanoScroller
if (newHeight === oldHeight) {
Expand All @@ -78,7 +82,8 @@
// To make right calculation scroller must be reseted
// See https://github.com/maxaon/angular-nanoscroller/issues/4
$nanoElement.nanoScroller();
$nanoElement.nanoScroller({scroll: 'bottom'});
// Below line comented to avoid double triggering 'scrollend' event
//$nanoElement.nanoScroller({scroll: 'bottom'});
});

}
Expand Down