[CallLog] updated CallLog sources
authorPiotr Dabrowski <p.dabrowski2@samsung.com>
Thu, 29 Aug 2013 09:43:50 +0000 (11:43 +0200)
committerPiotr Dabrowski <p.dabrowski2@samsung.com>
Thu, 29 Aug 2013 09:43:50 +0000 (11:43 +0200)
Change-Id: I1ba144d3555aa16224b4241c131b03a139a2e7f3

js/app.ui.js

index 94fe871..f980b70 100644 (file)
@@ -482,7 +482,6 @@ function Ui(contacts) {
                                        autodividers: true,
                                        //filter: true,
                                        autodividersSelector: function ( li ) {
-                                               console.log("autodividersSelector")
                                                return $(li).find('.callDate').text() === new Date().toLocaleDateString() 
                                                ? "Today" : $(li).find('.callDate').text();
                                        }
@@ -554,7 +553,7 @@ function Ui(contacts) {
                                        }
                                }
                        }
-                       return name || number;
+                       return name || number || 'Unknown';
                },
 
                /**
@@ -583,7 +582,8 @@ function Ui(contacts) {
                                date = '',
                                elements = [],
                                len = entries.length,
-                               i;
+                               i,
+                               checkbox;
 
                        if (len) {
                                this.updateCallerHeader(entries[0], entries.length);
@@ -628,16 +628,23 @@ function Ui(contacts) {
                                this.changeDetailsToRemoveState();
                                // check previous checked entries
                                this.checkedLogs.forEach(function(logUid){
-                                       var checkbox = $('#forCallerList li.call[data-uid="' + logUid + '"]')
+                                       checkbox = $('#forCallerList li.call[data-uid="' + logUid + '"]')
                                                .find(':checkbox');
-                                       checkbox.attr('checked', true)
-                                               .data('checkboxradio')
-                                               .refresh();
 
                                        if (checkbox.length > 0) {
+                                               checkbox.attr('checked', true)
+                                                       .data('checkboxradio')
+                                                       .refresh();
                                                $('#deleteActionBtn').removeClass('ui-disabled');
                                        }
                                });
+
+                               // close popup if there are no checked checkboxes
+                               if (!$("#forCallerList input:checked").length) {
+                                       if ($.mobile.popup.active) {
+                                               $.mobile.popup.active.close();
+                                       }
+                               }
                        }
                        this.addEventsForCallerListCheckboxes();
                        // lock buttons if unknown caller