mirror of
https://github.com/apache/cordova-plugin-statusbar.git
synced 2026-04-27 00:00:06 +08:00
CB-10636 Add JSHint for plugins
This commit is contained in:
@@ -18,8 +18,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
var cordova = require('cordova');
|
||||
|
||||
function notSupported() {
|
||||
console.log('StatusBar is not supported');
|
||||
return false;
|
||||
|
||||
@@ -18,16 +18,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
var _supported = null; // set to null so we can check first time
|
||||
/* global Windows */
|
||||
|
||||
function isSupported() {
|
||||
// if not checked before, run check
|
||||
if (_supported == null) {
|
||||
var _supported = null; // set to null so we can check first time
|
||||
|
||||
function isSupported() {
|
||||
// if not checked before, run check
|
||||
if (_supported === null) {
|
||||
var viewMan = Windows.UI.ViewManagement;
|
||||
_supported = (viewMan.StatusBar && viewMan.StatusBar.getForCurrentView);
|
||||
}
|
||||
return _supported;
|
||||
}
|
||||
}
|
||||
|
||||
function getViewStatusBar() {
|
||||
if (!isSupported()) {
|
||||
@@ -94,14 +96,14 @@ module.exports = {
|
||||
},
|
||||
|
||||
show: function (win, fail) {
|
||||
// added support check so no error thrown, when calling this method
|
||||
// added support check so no error thrown, when calling this method
|
||||
if (isSupported()) {
|
||||
getViewStatusBar().showAsync().done(win, fail);
|
||||
}
|
||||
},
|
||||
|
||||
hide: function (win, fail) {
|
||||
// added support check so no error thrown, when calling this method
|
||||
// added support check so no error thrown, when calling this method
|
||||
if (isSupported()) {
|
||||
getViewStatusBar().hideAsync().done(win, fail);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user