[CallLog] updated CallLog sources
[samples/web/CallLog.git] / js / app.ui.js
index 89e9d20..e53b8b0 100644 (file)
@@ -149,13 +149,13 @@ function Ui(contacts) {
                        $('#smsActionBtn').on('click', function (event) {
                                event.stopPropagation();
                                event.preventDefault();
-                               self.lockButtons();
+                               self.lockButtons('#smsActionBtn');
                                self.hideCheckboxes();
                                app.sendSms($('#forCallerList').data('remoteParty'));
                        });
 
                        $('#callActionBtn').on("click", function (event) {
-                               self.lockButtons();
+                               self.lockButtons('#callActionBtn');
                                self.hideCheckboxes();
                                app.makeCall($('#forCallerList').data('remoteParty'));
                        });
@@ -188,7 +188,7 @@ function Ui(contacts) {
 
                        $( "#errorPopup" ).bind({
                                popupafterclose: function(){
-                                       self.unlockOptionButtons();
+                                       self.unlockButtons();
                                }
                        });
 
@@ -496,16 +496,6 @@ function Ui(contacts) {
                                }
                        }, 0);
 
-                       /* workaround for registering call during working app in removeMode */
-                       if (this.removeMode) {
-                               if ($('#selectAllDetails').attr('checked')){
-                                       this.selectAll();
-                               }
-                               $('.toRemove, .selectAllBox', $('#historyForCallerView'))
-                                       .removeClass('hidden');
-                               $('#forCallerList .toRemove').show()
-                       }
-
                        setTimeout(this.helpers.scrollTo.bind(this, calllogListContent, calllogListContentPos), 10);
                },
 
@@ -634,6 +624,7 @@ function Ui(contacts) {
                        // change to remove mode if it was active before registering call
                        if (this.removeMode) {
                                this.removeMode = !this.removeMode;
+                               this.setSelectAllDetails();
                                this.changeDetailsToRemoveState();
                                // check previous checked entries
                                this.checkedLogs.forEach(function(logUid){
@@ -657,10 +648,10 @@ function Ui(contacts) {
                        }
                        this.addEventsForCallerListCheckboxes();
                        // lock buttons if unknown caller
-                       if(remoteParty) {
-                               this.unlockOptionButtons();
+                       if (remoteParty) {
+                               this.unlockButtons();
                        } else {
-                               this.lockButtons();
+                               this.lockButtons('#callActionBtn, #smsActionBtn');
                        }
                },
 
@@ -677,7 +668,7 @@ function Ui(contacts) {
                 * @param numberOfEntries
                 */
                updateCallerHeaderNumberOfEntries: function Ui_updateCallerHeaderNumberOfEntries(numberOfEntries) {
-                       $('.infoContainer .numberOfEntries').html(numberOfEntries);
+                       $('.infoContainer .numberOfEntries').html('' + numberOfEntries + ' ' + (numberOfEntries === 1 ? 'call' : 'calls'));
                },
 
                /**
@@ -771,11 +762,11 @@ function Ui(contacts) {
                        });
                },
 
-               lockButtons: function () {
-                       $('#callActionBtn, #smsActionBtn').addClass('ui-disabled').attr('tabIndex', '-1').blur();
+               lockButtons: function Ui_lockButtons(buttons) {
+                       $(buttons).addClass('ui-disabled').attr('tabIndex', '-1').blur();
                },
 
-               unlockOptionButtons : function Ui_unlockOptionButtons(){
+               unlockButtons: function Ui_unlockButtons(){
                        $('#callActionBtn, #smsActionBtn').removeClass('ui-disabled').attr('tabIndex', '0');
                },