The app.onShown
event is called when the app is run.
Type:
Function
app.onShown = function (url) {};
app.onShown
has one entry argument in order to display.
Parameters | Type | Description |
---|---|---|
url | String | The url path to display in the app |
// on shown
app.onShown = function (url) {
if (url) {
if (url.indexOf('?p=') > -1)
videoPage.show(url);
}
};
The app.onHidden
event is called when the app is on background.
Type:
Function
app.onHidden = function () {};
// on hidden
app.onHidden = function () {
if (app.local.video.wasPlaying = app.local.video.isPlaying)
app.functions.video.stop();
};
The app.beforePageChanged
event is called before every page in FrameworkJS has been changed.
Type:
Function
app.beforePageChanged = function (page) {};
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. |
// before page changed
app.beforePageChanged = function (page) {
if (page.name === 'client')
$('.page.' + page.name).css('background-color', '#000000');
};
The app.afterPageChanged
event is called after every page in FrameworkJS has been changed.
Type:
Function
app.afterPageChanged = function (page, args) {};
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. |
// 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'
});
}
};