Code Monkey home page Code Monkey logo

ember-simple-infinite-scroller's People

Contributors

amk221 avatar cyk avatar ember-tomster avatar mikerhyssm avatar philliphaines 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

Watchers

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

ember-simple-infinite-scroller's Issues

Forced rerender by isScrollable

Ember 3.14.2
Infinite scroll 6.0.2

It seems, that your plugin forces a rerender, when evaluating the scroll position on the 'did-insert' event. I tried to debounce it with Ember.run.later inside handleInsertElement which seems to remove the forced rerender but keep the initial behaviour.

Bildschirmfoto 2020-01-23 um 09 22 15

Not working with bootstrap scrollspy

Hi. Thanks for this ember add-on. I'm having difficulty using it in conjunction with bootstrap scroll-spy. Here is my template markup.

 <div class="scroll-watcher" data-spy="scroll" data-target="list-group">    
            <div class="list-group">
            {{#infinite-scroller on-load-more=(action 'nextPage') as |scroller|}}
                {{#each model as |material|}}
                        {{#link-to "materials.detail" material class="list-group-item"}}
                                <span class="badge">{{material.code}}</span>
                                <h4 class="list-group-item-heading">{{material.name}}</h4>
                                <p class="list-group-item-text">
                                    {{material.category.value}}
                                </p>
                        {{/link-to}}
                {{/each}}
            {{/infinite-scroller}}
            </div>     
        </div>

The nextPage action is not triggered when I reach the bottom of the scroll box. I know my controller action setup is working fine when I set use-document=true and scroll to the bottom of the page the action triggers correctly. I need to get it working on my bootstrap scroll box though? Is this an issue or have I just done something silly.

FastBoot Support

Lately I've been getting the following error:

ReferenceError: document is not defined
    at Module.callback (/Users/mhluska/project/tmp/broccoli_persistent_filterreplace_filter-output
_path-SkDKJc9B.tmp/assets/addon-tree-output/@zestia/ember-simple-infinite-scroller/services/-infinite-scroller.js:8:1)

Would it be possible to support FastBoot by not referencing document if typeof FastBoot !== 'undefined'?

Importing component?

Is there a way to import the component and extend it?

I tried something like this and no luck:

import EmberSimpleInfiniteScroller from '@zestia/ember-simple-infinite-scroller';

scroller.isLoading not working (could be a user issue)

The line {{log scroller}} below produces the following in dev tools on the first call:
EmptyObject {error: null, isScrollable: undefined, isLoading: false, loadMore: ƒ}
and this on each additional call:
EmptyObject {error: null, isScrollable: false, isLoading: false, loadMore: ƒ}

My action 'loadMore' is on my controller and updates my model after making a new fetch.

{{#infinite-scroller useDocument=true onLoadMore=(action "loadMore") as |scroller|}} 
  {{#each model.groupedPosts as |group index|}}
    {{blog/post-card group=group index=index length=postsLength}}
  {{/each}}
  {{log scroller}}
  {{#if scroller.isLoading}}
    <script>
      document.body.style.background = "red";
    </script>
  {{/if}}
{{/infinite-scroller}}

on-load-more not fired when the element has padding

When using the infinite-scroller component with use-document=false and padding .infinite-scroller: { padding: 15px; }, on-load-more is not fired. It's because the height returned by _scrollerHeight is not taking into account padding. A way to fix it is just to use jQuery's outerHeight function like so:

// addon/components/infinite-scroller.js

_scrollerHeight() {
  if (this.getAttr('use-document')) {
    return this.get('_infiniteScroller').$window().outerHeight();
  } else {
    return this.$scroller().outerHeight();
  }
}

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.