maxaon / angular-nanoscroller Goto Github PK
View Code? Open in Web Editor NEWWrapper for nanoScrollerJS
License: MIT License
Wrapper for nanoScrollerJS
License: MIT License
Is it possible to change the name of the folder "bin"?
In windows server this folder name is not accessible.
Bin folder is not intended as a place where a developer should put web pages.
http://stackoverflow.com/questions/11324481/error-404-on-bin-browsing
Hi, I'm using your wrapper and needed to bind some behavior to the scroll, in this case the 'scrollend' event (very useful to implement an infinite scroll).
To see how it worked in my solution I added this on the link of the directive;
if(attr.scrollend)
element.bind('scrollend', function () {
scope.$apply(attr.scrollend);
});
and this on the html...
<scrollable scrollend="loadMyObjects()">
It worked like a charm.
Now that we are here, related to this particular event, there is a hack that causes this event to fire twice, maybe you could see if the hack is still needed.
Let me know what you think about this, thanks.
I have a container which has max-height 600px. This container has nanoScroller. And if the height of this container changes dynamically (collapsing), then the main page scroll (browser scroll) moves the page to the top.
I have created a plunk, here is the link: plunk I am using nanoScrollerDirective . To replicate the issue, scroll down to the page bottom and press "Add item to list". Afterwards you'll see that the browser scroll moved up. Thanks in advance.
Please help. Thanks in advance.
The function below not work for check if angular using jqLite ot jQuery in the last version of angular.
Maybe we need change to check if element have a exclusive jquery methods.
//jQuery must be used, cause angular method 'find' has different behavior
if (angular.element !== $) {
throw new Error("Angular must use jQuery not jqLite");
}
//If scroller was on the bottom, scroll to bottom
else if (newHeight !== oldHeight && contentElement.scrollTop && (oldHeight - contentElement.scrollTop - parentElement.clientHeight) < scrollableConfig.bottomMargin) {
$nanoElement.nanoScroller({scroll: 'bottom'});
}
<div class="panel panel-default" ng-controller="tChatController">
<div class="panel-body" id="chat-msg-box" scrollable="{iOSNativeScrolling: true, scroll: 'bottom', preventPageScrolling: true}">
<ul class="media-list">
<li class="media" ng-repeat="msg in msgs">
<a class="pull-left" href="#">
<img class="media-object heading-img-thumbnail" src="..." alt="...">
</a>
<div class="media-body">
// msg.text //
</div>
</li>
</ul>
</div>
<form role="form" class="form">
<label class="sr-only" for="chat-input">Chat</label>
<textarea class="form-control xtra-textarea" id="chat-input" placeholder="Hi, ..." rows="1" ng-keypress="keyListener($event)" ng-model="text" msd-elastic></textarea>
</form>
</div>
'use strict';
angular.module('t.chat')
.controller('tChatController', ['$state', '$scope', 'tChatService',
function ($state, $scope, tChatService) {
$scope.text = '';
$scope.msgs = [];
$scope.keyListener = function ($event) {
if (13 === $event.keyCode && 13 === $event.which && !$event.shiftKey) {
$event.preventDefault();
tChatService.send({
to: '4d117743-2c8f-4d30-a984-96e7ff1f5e30',
text: $scope.text
});
$scope.text = '';
}
};
tChatService.listener(function (data) {
$scope.msgs.push(data);
});
}
]);
Big THANKS!
Would it be possible to publish this repository on npm? Indeed, I'm using Webpack and thus, I use npm
instead of Bower on my projects.
Thanks! :)
Auto scroll to bottom when page was loaded seems not work.
<div class="panel-body" id="chat-msg-box" scrollable="{iOSNativeScrolling: true, scroll: 'bottom', preventPageScrolling: true}">
But the scrollbar always on top when page was loaded.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.