Coder Social home page Coder Social logo

lrinfinitescroll's People

Contributors

lloy0076 avatar lorenzofox3 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  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  avatar  avatar  avatar  avatar  avatar

lrinfinitescroll's Issues

Bower Package

Would be great if this was made into a bower package, and also if the documentation was added to.

Supporting full page scrolling.

I needed for my app to support full page scrolling so I've modified your directive to support "target" attribute. (Sorry I don't have time to do a PR). The following code supports both scrolling an element other than the current one (if you use routes and need to target a parent) and the special case of the whole page scrolling - 'window'.

Full code is in this gist: https://gist.github.com/SimeonC/a15055a5b9ec0c5685da.
Highlights below:

Inserted at Line 12:

bindTarget = element,
calculateRemaining = function(){
    return element[0].scrollHeight - (element[0].clientHeight + element[0].scrollTop);
};

if (attr.target) {
    if (attr.target.toLowerCase() === 'window') {
        bindTarget = angular.element(window);
        element = angular.element(document.querySelector('body'))
        calculateRemaining = function(){
            return element[0].offsetHeight - (window.pageYOffset + window.innerHeight);
        };
    }
    else element = angular.element(document.querySelector(attr.target));
}

Line 35:

bindTarget.bind(
    'scroll', function () {
        var remaining = calculateRemaining();
        //if we have reached the threshold and we scroll down

Repeating Directive not rendering new template

I have an issue with this setup:

<div lr-infinite-scroll="loadMore">
    <my-component type='item.type' ng-repeat='item in items'></my-component>
</div>

I have a directive inside with different html template for each item type. The infinite scrolling works perfectly but when I change the item array with items with different type the template remains the same.

Update release to 1.0.1 to support CommonJS

Heyo :)

First, thanks for writing such a nifty module!

Could you create a release 1.0.1 that points to revision bd8fd2b so CommonJS imports of this module are supported when installing via Bower? Currently, Bower installers have to write their own index.js file after installing.

Trouble getting scroll event

module looks great- thank you.
Having difficulty getting element.bind('scroll', function () { working. Module loads and line read; scrolling does not trigger function though. Can't get any element scrolling to trigger bound scroll function. Using:
<div class="search-grid container-fluid" ng-class="{starred: currentSearch.starred}" lr-infinite-scroll="loadMore()" scroll scroll-threshold="200" time-threshold="200" >

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.