Coder Social home page Coder Social logo

angular-nanoscroller's People

Contributors

bitdeli-chef avatar esmaeilpour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-nanoscroller's Issues

Support for scroller events

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.

Max-height for nano scrolls the whole page up

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.

Check jqLite not working in angular#1.3.15

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");
  }

There is offset when auto scroll to bottom

//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'});
}

Result

Befor rendering

before rendering

After rendering

after rendering

Code Snippet

Template

<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>

Controller

'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!

Publishing on npm?

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! :)

Token '=' is unexpected

Hi,

I am trying to pass the preventPageScrolling parameter doing
scrollable="{preventPageScrolling='true'}" and I am getting this error

captura de tela 2015-02-10 as 12 48 33

What is the proper way of doing it?

scroll not working

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.