[CallLog] updated CallLog sources
authorPiotr Dabrowski <p.dabrowski2@samsung.com>
Wed, 31 Jul 2013 10:44:30 +0000 (12:44 +0200)
committerPiotr Dabrowski <p.dabrowski2@samsung.com>
Wed, 31 Jul 2013 10:44:30 +0000 (12:44 +0200)
Change-Id: Ifcde6b6fedbcd38fbdc73178e7974a2d56340fc4

js/app.js
js/app.ui.js

index bf84695..74be801 100644 (file)
--- 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();
                                        }
                                }
                        );
index b7e8b3d..549673e 100644 (file)
@@ -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