• This project
    • Loading...
  • Sign in

fe / yohobuywap-node · Files

Go to a project

GitLab

  • Go to group
  • Project
  • Activity
  • Files
  • Commits
  • Pipelines 0
  • Builds 0
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Members
  • Labels
  • Wiki
  • Forks
  • Network
  • Create a new issue
  • yohobuywap-node
  • public
  • js
  • 3party
  • material
  • view.js
  • 开发完成
    8317da15
    by 李靖
    2017-06-14 10:30:22 +0800  
    Browse Files
view.js 460 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
import {
    View
} from 'yoho-mvc';

class GetMore extends View {
    constructor() {
        super('.material-c');

        // srcoll to load more
        $(window).scroll(() => {
            window.requestAnimationFrame(this.scrollHandler.bind(this));
        });
    }

    scrollHandler() {
        if (($(window).scrollTop() + $(window).height() >= $(document).height() * 0.8)) {
            this.emit('more');
        }
    }
}

export {
    GetMore
};