Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 799132 - [DIALER] more contacts with same number
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvargauk committed Oct 16, 2012
1 parent d5c0966 commit 6db0966
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 25 deletions.
7 changes: 7 additions & 0 deletions apps/communications/dialer/js/contacts.js
Expand Up @@ -52,6 +52,13 @@ var Contacts = {
var matchResult = SimplePhoneMatcher.bestMatch(variants, matches);

var contact = request.result[matchResult.bestMatchIndex];

if (request.result.length > 1) {
var name = contact.name[0].substring(0, 8),
numOfothers = request.result.length - 1;
contact.name[0] = _('lineContactName', {name: name, n: numOfothers});
}

var matchingTel = contact.tel[matchResult.localIndex];
callback(contact, matchingTel);
};
Expand Down
3 changes: 1 addition & 2 deletions apps/communications/dialer/js/handled_call.js
Expand Up @@ -22,7 +22,7 @@ function HandledCall(aCall, aNode) {
this.node = aNode;
this.durationNode = aNode.querySelector('.duration span');
this.directionNode = aNode.querySelector('.duration .direction');
this.numberNode = aNode.querySelector('.number');
this.numberNode = aNode.querySelector('.numberWrapper .number');
this.additionalInfoNode = aNode.querySelector('.additionalContactInfo');


Expand Down Expand Up @@ -99,7 +99,6 @@ HandledCall.prototype.updateCallNumber = function hc_updateCallNumber() {
Contacts.findByNumber(number, function lookupContact(contact, matchingTel) {
if (contact && contact.name) {
node.textContent = contact.name;
KeypadManager.formatPhoneNumber('right');
var additionalInfo = Utils.getPhoneNumberAdditionalInfo(matchingTel,
contact);
additionalInfoNode.textContent = additionalInfo ?
Expand Down
6 changes: 3 additions & 3 deletions apps/communications/dialer/locales/dialer.en-US.properties
Expand Up @@ -42,6 +42,6 @@ sending=Sending...
ussd-services={{ operator }} services
type-your-response.placeholder=Type your response...
clear-all-text=Clear all text



message-successfully-sent=MESSAGE SUCCESSFULLY SENT
ussd-server-error=THERE WAS AN ERROR IN THE COMMUNICATION, PLEASE TRY IT AGAIN LATER
lineContactName={{ name }}... or {{ n }} other
3 changes: 2 additions & 1 deletion apps/communications/dialer/oncall.html
Expand Up @@ -30,7 +30,8 @@
<article id="call-screen" class="grid">
<article id="calls" data-count="0">
<section>
<div class="number">
<div class="numberWrapper">
<div class="number"></div>
</div>
<div class="fake-number">
</div>
Expand Down
43 changes: 24 additions & 19 deletions apps/communications/dialer/style/oncall.css
Expand Up @@ -317,13 +317,20 @@ button[disabled] .icon-keypad-visibility {
background-color: transparent;
}

#calls[data-count="1"] > section .number {
height: 4rem;
padding: 2rem 2rem 0 2rem;
#calls[data-count="1"] > section .numberWrapper {
background: #01c5ed;
font-size: 1.6em;
overflow: auto;
}

#calls[data-count="1"] > section .numberWrapper .number{
height: 4rem;
padding: 2rem 2rem 0 0;
font-size: 2.4rem;
line-height: 4rem;
color: black;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

#calls > section .fake-number {
Expand Down Expand Up @@ -362,7 +369,7 @@ button[disabled] .icon-keypad-visibility {
opacity: 0.7;
}

#calls > section .number {
#calls > section .numberWrapper {
font-size: 1.5em;
white-space: nowrap;
}
Expand Down Expand Up @@ -539,24 +546,22 @@ button[disabled] .icon-keypad-visibility {
font-size: 1.8em;
}

#calls > section .number,
#calls[data-count="1"] > section .number {
width: -moz-calc(100% - 12rem);
#calls > section .numberWrapper,
#calls[data-count="1"] > section .numberWrapper {
width: -moz-calc(100% - 10rem);
height: -moz-calc(100% - 2rem);
padding: 1rem;
margin-left: 3rem;
background-color: transparent;
}

#calls > section .numberWrapper .number,
#calls[data-count="1"] > section .numberWrapper .number{
width: 100%;
padding: 1rem 1rem 1rem 1.5rem;
font-size: 2rem;
line-height: 100%;
color: white;
background-color: transparent;
white-space: nowrap;
text-overflow: ellipsis;

/* font-size is overwriten via JS and we need
to be sure it doesn't happen when the call is
in the status bar. Workarounds would imply
listening resize event and JS changes, so we
need to add !important here */
font-size: 1.1em !important;
overflow: hidden;
}

#calls > section .duration,
Expand Down

0 comments on commit 6db0966

Please sign in to comment.