Update is for when the project need an automated internal update. For update html, css and js codes in user's device we can use it.
When an automated internal update occurred, app.update.onStarted()
event is called and you can handle the update codes. It has no entry argument.
Type:
Function
app.update.onStarted = function () {};
// on update started
app.update.onStarted = function () {
// body...
};
When an automated internal update downloading progress being changed, this event is called.
Type:
Function
app.update.onProgressChanged = function (percentage) {};
You can create an update page for handling update progress. The codes will comes inside the app.update.onProgressChanged
to handle the percentage of completed updates.
Parameters | Type | Description |
---|---|---|
percentage | String | The callback percentage of changing update process. |
// on update progress changed
app.update.onProgressChanged = function (percentage) {
if (app.page.name === 'update')
$('.page.update > .progress > div').css('width', percentage + '%');
};
When the update operation is completed, app.update.onCompleted
event is called. It means, for handling what happens after completing the update, this section can handle codes.
Type:
Function
app.update.onCompleted = function () {};
// on update completed
app.update.onCompleted = function () {
if (app.page.name === 'update')
alert('Your update is completed!');
};