New method isActive to receive if mode is active

This commit is contained in:
Sebastián Katzer
2014-12-14 14:23:57 +01:00
parent fc6e6cf51d
commit 8f2c75321c
5 changed files with 66 additions and 25 deletions

View File

@@ -29,7 +29,7 @@ document.addEventListener('backbutton', function () {}, false);
// Called before 'deviceready' listener will be called
channel.onCordovaReady.subscribe(function () {
// Device plugin is ready now
channel.onCordovaInfoReady.subscribe( function () {
channel.onCordovaInfoReady.subscribe(function () {
// Set the defaults
exports.setDefaults({});
});
@@ -44,10 +44,17 @@ channel.onCordovaReady.subscribe(function () {
/**
* @private
*
* Flag indicated if the mod is enabled.
* Flag indicated if the mode is enabled.
*/
exports._isEnabled = true;
/**
* @private
*
* Flag indicated if the mode is active.
*/
exports._isActive = true;
/**
* @private
*
@@ -125,7 +132,7 @@ exports.configure = function (options) {
};
/**
* If the mode is enabled or not.
* If the mode is enabled or disabled.
*
* @return {Boolean}
*/
@@ -133,6 +140,15 @@ exports.isEnabled = function () {
return this._isEnabled;
};
/**
* If the mode is active.
*
* @return {Boolean}
*/
exports.isActive = function () {
return this._isActive;
};
/**
* Called when the background mode has been activated.
*/