From: Piotr Dabrowski Date: Wed, 31 Jul 2013 10:44:30 +0000 (+0200) Subject: [CallLog] updated CallLog sources X-Git-Tag: 2.2.1_release~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad991edf1e9483e7365efded47320e4652632288;p=samples%2Fweb%2FCallLog.git [CallLog] updated CallLog sources Change-Id: Ifcde6b6fedbcd38fbdc73178e7974a2d56340fc4 --- diff --git a/js/app.js b/js/app.js index bf84695..74be801 100644 --- a/js/app.js +++ b/js/app.js @@ -49,8 +49,8 @@ var App = null; this.config = new Config(); this.model = new Model(); this.model.registerChangeListener(this.updateCallLists.bind(this)); - this.ui = new Ui(); + this.updateCallLists(); return this; }, @@ -59,6 +59,8 @@ var App = null; * Updates call history and caller detailed history lists */ updateCallLists: function App_updateCallLists() { + // workaround - time zone update + tizen.time.getCurrentDateTime().toLocalTimezone(); // workaround; setTimeout(this.showHistoryForCaller(this.lastViewedCaller), 500); this.showCallHistory(); @@ -144,7 +146,6 @@ var App = null; function (e) { console.error('Message launch error: ', e); self.ui.showErrorPopup('Message service is unavailable'); - app.ui.unlockOptionButtons(); }, { onsuccess: function () { @@ -153,7 +154,6 @@ var App = null; onfailure: function (er) { console.error('Message service launch error: ', er); self.ui.showErrorPopup('Message service is unavailable'); - app.ui.unlockOptionButtons(); } } ); diff --git a/js/app.ui.js b/js/app.ui.js index b7e8b3d..549673e 100644 --- a/js/app.ui.js +++ b/js/app.ui.js @@ -144,6 +144,8 @@ function Ui(contacts) { }); $('#smsActionBtn').on('tap', function (event) { + event.stopPropagation(); + event.preventDefault(); self.lockButtons(); self.hideCheckboxes(); app.sendSms($('#forCallerList').data('remoteParty')); @@ -181,6 +183,12 @@ function Ui(contacts) { $('#errorPopup').on('tap', '#errorPopupOkBtn', this.closeErrorPopup); + $( "#errorPopup" ).bind({ + popupafterclose: function(){ + self.unlockOptionButtons(); + } + }); + $(window).keyup(function(e){ if (e.which === 13) { $('input:focus').blur(); @@ -674,7 +682,9 @@ function Ui(contacts) { contactsFoundCB = function (contacts) { this.contactsLoaded = contacts; - callback(); + if (callback instanceof Function) { + callback(); + } }; errorCB = function (error) { @@ -711,6 +721,7 @@ function Ui(contacts) { } }); } else { + self.loadContacts(app.updateCallLists.bind(app)); $('#callActionBtn, #smsActionBtn') .removeClass('ui-disabled'); } @@ -721,6 +732,10 @@ function Ui(contacts) { $('#callActionBtn, #smsActionBtn').addClass('ui-disabled'); }, + unlockOptionButtons : function Ui_unlockOptionButtons(){ + $('#callActionBtn, #smsActionBtn').removeClass('ui-disabled'); + }, + /** * WORKAROUND; * Patch for UI, bad refresh scrollView