diff --git a/js/app.js b/js/app.js
index 124510f..b48f869 100644
--- a/js/app.js
+++ b/js/app.js
@@ -116,6 +116,9 @@ var app = null;
this.getAddressBooksError.bind(this)
);
} catch (e) {
+ if (e.name === "SecurityError") {
+ this.ui.showPopupWarning();
+ }
console.error('getAddressBooks() error: ' + e.message);
}
},
diff --git a/js/app.nfc.js b/js/app.nfc.js
index 30aa4e0..a252e61 100644
--- a/js/app.nfc.js
+++ b/js/app.nfc.js
@@ -232,6 +232,7 @@
this.nfcAdapter.setPowered(true, this.onPowerOn.bind(this), this.onPowerOnFails.bind(this));
} catch (e) {
console.error('startNFC problem', e);
+ this.app.ui.showPopupWarning();
}
},
diff --git a/js/app.ui.js b/js/app.ui.js
index 52fb5a4..290c01a 100644
--- a/js/app.ui.js
+++ b/js/app.ui.js
@@ -125,6 +125,12 @@ App.Ui = null;
/**
* @returns {string}
*/
+ showPopupWarning: function ui_showPopupWarning(){
+ setTimeout(function(){
+ $("#contact-nfc-error").popup("open",{"positionTo":"window"});
+ },500);
+ },
+
getTemporaryBoxContentHtml: function ui_getTemporaryBoxContentHtml() {
return '
'
+ 'Default card is not defined yet!
'
@@ -540,6 +546,11 @@ App.Ui = null;
self.verticalCenter($('#startBox'));
}, 20);
});
+ $( "#contact-nfc-error" ).bind({
+ popupafterclose: function(){
+ tizen.application.getCurrentApplication().exit();
+ }
+ });
document.addEventListener('tizenhwkey', function(e) {
if (e.keyName == "back") {
@@ -551,6 +562,14 @@ App.Ui = null;
}
});
+ document.addEventListener('webkitvisibilitychange', function () {
+ if(document.webkitVisibilityState === "visible") {
+ if ($.mobile.activePage.attr('id') === "choose") {
+ $.mobile.activePage.trigger('pageshow');
+ }
+ }
+ });
+
$('#transfer').on('pageshow', function () {
if (tizen.nfc.getDefaultAdapter().powered) {
try {