From: Jimmy Huang Date: Tue, 21 Oct 2014 00:02:08 +0000 (-0700) Subject: Fixed a bug where alpha filter is not working in contacts X-Git-Tag: accepted/tizen/ivi/20141208.013020~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F61%2F29061%2F2;p=profile%2Fivi%2FModello_Phone.git Fixed a bug where alpha filter is not working in contacts Change-Id: Ibbe1c5ba3ff2ab3d4c2417eda247ef2a5c903e05 Signed-off-by: Jimmy Huang --- diff --git a/js/phone.js b/js/phone.js index 35ebedd..7be5db7 100644 --- a/js/phone.js +++ b/js/phone.js @@ -51,8 +51,20 @@ var Phone = (function() { this.contactsComputed = ko.computed(function() { if (self.contactsAlphabetFilter() !== "") { return ko.utils.arrayFilter(self.contacts(), function(contact) { - if ( !! contact.name && !! contact.name.leftLastName) { - return contact.name.lastName.toString().toLowerCase().trim().indexOf( + if (!!contact.name) { + var name = null; + if (!!contact.name.displayName){ + name = contact.name.displayName; + } else if (!!contact.name.lastName) { + name = contact.name.lastName; + } else if (!!contact.name.firstName) { + name = contact.name.firstName; + } + + if (!name) + return false; + + return name.toString().toLowerCase().trim().indexOf( self.contactsAlphabetFilter().toString().toLowerCase().trim()) === 0; } return false; diff --git a/packaging/modello-phone.changes b/packaging/modello-phone.changes index 96ab697..e3970e8 100644 --- a/packaging/modello-phone.changes +++ b/packaging/modello-phone.changes @@ -1,3 +1,6 @@ +* Mon Oct 20 2014 Jimmy Huang accepted/tizen/3.0.m14.3/ivi/20141018.100013-1-gce6f884 +- Fixed a bug where alpha filter is not working in contacts + * Tue Oct 07 2014 Brian Jones submit/tizen_ivi/20141007.174646-1-g4679ed8 - clean the spec file - Fix for TC-1560 UI always zoomed out