Navigation

Navigation API is used to manage the details of navigation after departure and destination locations have been identified.

app.onShown()

The app.onShown event is called when the app is run.

  • Type: Function

    app.onShown = function (url) {};

  • Detail

    app.onShown has one entry argument in order to display.

    Parameters Type Description
    url String The url path to display in the app
  • Example
    Performing an onShown function configuration inside the app.js:
    // on shown
    app.onShown = function (url) {
        if (url) {
            if (url.indexOf('?p=') > -1)
                videoPage.show(url);
        }
    };

app.onHidden()

The app.onHidden event is called when the app is on background.

  • Type: Function

    app.onHidden = function () {};

  • Example
    Performing an onHidden function configuration inside the app.js:
    // on hidden
    app.onHidden = function () {
        if (app.local.video.wasPlaying = app.local.video.isPlaying)
            app.functions.video.stop();
    };

app.beforePageChanged()

The app.beforePageChanged event is called before every page in FrameworkJS has been changed.

  • Type: Function

    app.beforePageChanged = function (page) {};

  • Detail

    The app.beforePageChanged will be run before a page has been changed. It has one parameter, which named page. It contain the name of page for manipulation in this event.

    Parameters Type Description
    page Object Contain of the name of page.
  • Example
    Performing a before page changed event configuration inside the app.js:
    // before page changed
    app.beforePageChanged = function (page) {
        if (page.name === 'client')
            $('.page.' + page.name).css('background-color', '#000000');
    };

app.afterPageChanged()

The app.afterPageChanged event is called after every page in FrameworkJS has been changed.

  • Type: Function

    app.afterPageChanged = function (page, args) {};

  • Detail

    The app.afterPageChanged will be run after a page has been changed. It has two parameters, which named page and args. The first one is contains the name of page, and the second one is some need's arguments in order to be manipulating in this event.

    Parameters Type Description
    page Object Contain of the page name.
    args Object Contain the page arguments.
  • Example
    Performing a after page changed configuration inside the app.js:
    // after page changed
    app.afterPageChanged = function (page, args) {
        var bar = $('.page.' + page.name).attr('bar');
        if ((bar === 'black') || (bar === 'transparent')) {
            app.setAppearance({
                backgroundColor: '#0f0f0f',
                statusBar: 'light'
            });
        }
        else if (bar === 'grey') {
            app.setAppearance({
                backgroundColor: '#3b3b3b',
                statusBar: 'light'
            });
        }
    };