KUMobile

API Docs for: 0.0.2

KUMobile.News

Module: KUMobile

Contains all news related functions for loading and controlling the news page.

loadNextPage

()

Loads and displays the next set of news items.

Example:

KUMobile.News.loadNextPage();

listQueue

Array private

Contains the current list of article DOM

  • tag items that still need to be added to the DOM (much faster to add all at once after load is done downloading). This helps prevent the application from seeming to hang or become unresponsive.

  • LOAD_THRESHOLD_PX

    int

    Designates the minimum number of pixels that the user can scroll (calculated from the bottom) before another load event is triggered.

    Default: 660

    loading

    boolean

    Is the news page loading?

    Default: false

    page

    int

    Current page number as referenced from the news website.

    Default: 0

    pageQueue

    Array private

    Contains the current list of pages DOM data-role="page" items that still need to be added to the DOM (much faster to add all at once after load is done downloading). This helps prevent the app from seeming to hang or become unresponsive.

    PAGES_TO_LOAD

    int

    Number of pages to load from the news website after a trigger event occurs.

    Default: 2

    queue

    int private

    How many pages that need to be downloaded still. This is used to asynchronously download pages.

    Default: 0

    articlePageCreate

    Called on create of an article page. Mainly this function just attempts to download the article and show it.

    pageCreate

    Triggered when the news page is first created based on jQuery Mobile pagecreate event. This is called after the page itself is created but before any jQuery Mobile styling is applied.

    pageInit

    Triggered when the news page is first initialized based on jQuery Mobile pageinit event.

    scroll

    Triggered when regular scroll event happens in news scroller window. It is used to check if the user is near the bottom of the page, so more content can be loaded (simulate infinite scrolling).