From 813d7b0639b6d1193ada4b489815a54bf2b877d3 Mon Sep 17 00:00:00 2001 From: Piotr Dabrowski Date: Tue, 23 Jul 2013 12:09:07 +0200 Subject: [PATCH] [CallLog] updated CallLog sources Change-Id: Icafc2c3c08ecfd0f3df654ae09a30a08fee68acf --- js/app.ui.js | 31 +++++++++++++++++++++++++++---- templates/messageWindow.tpl | 2 +- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/js/app.ui.js b/js/app.ui.js index 5ca6143..b7e8b3d 100644 --- a/js/app.ui.js +++ b/js/app.ui.js @@ -189,7 +189,9 @@ function Ui(contacts) { document.addEventListener('tizenhwkey', function(e) { if (e.keyName == "back") { - if (self.removeMode === true) { + if ($.mobile.popup.active) { + $.mobile.popup.active.close(); + }else if (self.removeMode === true) { app.ui.changeDetailsToRemoveState(undefined, true); } else if ($.mobile.activePage.attr('id') === 'callView') { tizen.application.getCurrentApplication().exit(); @@ -224,9 +226,17 @@ function Ui(contacts) { }, selectCheckbox: function (obj, state) { + var deleteButton = $('#deleteActionBtn'), numChecked; obj.attr('checked', state) .data('checkboxradio') .refresh(); + + numChecked = $('#forCallerList input:checked').length; + if (this.removeMode && numChecked === 0 && !deleteButton.hasClass('ui-disabled')) { + deleteButton.addClass('ui-disabled'); + } else if (deleteButton.hasClass('ui-disabled')) { + deleteButton.removeClass('ui-disabled'); + } }, /** @@ -334,7 +344,8 @@ function Ui(contacts) { }, changeDetailsToRemoveState: function Ui_changeDetailsToRemoveState(set, clear) { - var counter = this.getCountSelectedLogEntries(); + var counter = this.getCountSelectedLogEntries(), + numChecked = $('#forCallerList input:checked').length; if (clear === true) { counter = 0; $('#forCallerList').find(':checkbox').attr('checked', false) @@ -348,6 +359,13 @@ function Ui(contacts) { this.removeMode = !this.removeMode; } + if (this.removeMode && numChecked === 0) { + $('#deleteActionBtn').addClass('ui-disabled'); + } else if (!this.removeMode) { + $('#deleteActionBtn').removeClass('ui-disabled'); + this.selectAllDetailsEach(); + } + if (counter === 0) { if (this.removeMode) { $('#historyForCallerView .toRemove').removeClass('hidden'); @@ -586,6 +604,10 @@ function Ui(contacts) { checkbox.attr('checked', true) .data('checkboxradio') .refresh(); + + if (checkbox.length > 0) { + $('#deleteActionBtn').removeClass('ui-disabled'); + } }); this.checkedLogs = []; } @@ -672,8 +694,9 @@ function Ui(contacts) { }, scrollToBottom: function () { - $(".ui-scrollview-view") - .css("-webkit-transform", "translate3d(0px, -" + scrollView.height() + "px, 0px)"); + var scrollView = $(".ui-scrollview-view"); + scrollView.css("-webkit-transform", "translate3d(0px, -" + + scrollView.height() + "px, 0px)"); }, onVisibilityChange: function () { diff --git a/templates/messageWindow.tpl b/templates/messageWindow.tpl index 9b67b4b..d916cae 100644 --- a/templates/messageWindow.tpl +++ b/templates/messageWindow.tpl @@ -1,7 +1,7 @@ -- 2.7.4