From: gs86.lee Date: Fri, 26 Apr 2013 05:27:23 +0000 (+0900) Subject: [ContactsExchanger]update ContactsExchanger(tizen_2.1) X-Git-Tag: 2.2_release~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2d0aca9eab4b6f60e6a98cf34c951a40de81b23;p=samples%2Fweb%2FContactsExchanger.git [ContactsExchanger]update ContactsExchanger(tizen_2.1) Change-Id: I781cb1674efc29ebadbfc6f8ce04bf38c597e1cc --- diff --git a/js/app.ui.js b/js/app.ui.js index 1f513ec..dee8607 100644 --- a/js/app.ui.js +++ b/js/app.ui.js @@ -201,8 +201,17 @@ App.Ui = null; */ readFromCard: function ui_readFromCard(event) { event.preventDefault(); - $('#transfer').data('option', 'read'); - $.mobile.changePage('#transfer'); + if (tizen.nfc.getDefaultAdapter().powered) { + try { + $('#transfer').data('option', 'read'); + $.mobile.changePage('#transfer'); + } catch (e) { + console.error(e.message); + } + } else { + $.mobile.changePage('#start'); + alert('Please turn on NFC adapter'); + } }, /** @@ -221,8 +230,16 @@ App.Ui = null; */ writeToCard: function ui_writeToCard(event) { event.preventDefault(); - $('#transfer').data('option', 'write'); - $.mobile.changePage('#transfer'); + if (tizen.nfc.getDefaultAdapter().powered) { + try { + $('#transfer').data('option', 'write'); + $.mobile.changePage('#transfer'); + } catch (e) { + console.error(e.message); + } + } else { + alert('Please turn on NFC adapter'); + } }, /**