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

Commit

Permalink
Merge pull request #9596 from gtorodelvalle/dialer-bug-869446-fix-cal…
Browse files Browse the repository at this point in the history
…l-log-filters

Bug 869446 - [Dialer][BB] Adapting the Call Log filters to the latest up dates in the Tab BB (r=crdlc)
  • Loading branch information
gtorodelvalle committed May 8, 2013
2 parents 752e1bf + 4fd8967 commit b2026cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 32 deletions.
32 changes: 20 additions & 12 deletions apps/communications/dialer/js/recents.js
Expand Up @@ -227,8 +227,8 @@ var Recents = {
},

filter: function re_filter(event) {
// do nothing if selected tab is same that current
if (event.target.parentNode.classList.contains('selected')) {
// Do nothing if the selected tab is same that current
if (event.target.parentNode.getAttribute('aria-selected') === "true") {
return;
}
var action = event.target.dataset.action;
Expand Down Expand Up @@ -326,8 +326,16 @@ var Recents = {
this._missedViewGroupingPending = false;
}
}
this.allFilter.classList.toggle('selected');
this.missedFilter.classList.toggle('selected');
if (this.allFilter.getAttribute('aria-selected') === 'true') {
this.allFilter.removeAttribute('aria-selected');
} else {
this.allFilter.setAttribute('aria-selected', 'true')
}
if (this.missedFilter.getAttribute('aria-selected') === 'true') {
this.missedFilter.removeAttribute('aria-selected');
} else {
this.missedFilter.setAttribute('aria-selected', 'true');
}
this.limitVisibleEntries(100);
},

Expand Down Expand Up @@ -608,7 +616,7 @@ var Recents = {
'</div>';
navigator.mozL10n.translate(this.recentsContainer);
this.recentsIconEdit.parentNode.setAttribute('aria-disabled', 'true');
this.allFilter.classList.add('selected');
this.allFilter.setAttribute('aria-selected', 'true');
return;
}

Expand Down Expand Up @@ -644,18 +652,18 @@ var Recents = {
var event = new Object();
self._allViewGroupingPending = true;
self._missedViewGroupingPending = true;
if (self.missedFilter.classList.contains('selected')) {
self.missedFilter.classList.remove('selected');
if (self.missedFilter.getAttribute('aria-selected') === 'true') {
self.missedFilter.removeAttribute('aria-selected');
event.target = self.missedFilter.children[0];
self.filter(event);
self.missedFilter.classList.add('selected');
self.allFilter.classList.remove('selected');
self.missedFilter.setAttribute('aria-selected', 'true');
self.allFilter.removeAttribute('aria-selected');
} else {
self.allFilter.classList.remove('selected');
self.allFilter.removeAttribute('aria-selected');
event.target = self.allFilter.children[0];
self.filter(event);
self.missedFilter.classList.remove('selected');
self.allFilter.classList.add('selected');
self.missedFilter.removeAttribute('aria-selected');
self.allFilter.setAttribute('aria-selected', 'true');
}
});
},
Expand Down
20 changes: 0 additions & 20 deletions apps/communications/dialer/style/commslog.css
Expand Up @@ -55,26 +55,6 @@ ol, ul {
list-style: none;
}

/* Copying Filters BB styles for selected filter, but using .selected instead of :target */
ul[role="tablist"][data-type="filter"] > [role="tab"].selected {
background: #fff;
border: solid 1px #999;
border-top: none;
color: #000;
}

ul[role="tablist"][data-type="filter"] > [role="tab"]:first-child.selected {
border-left: none;
}

ul[role="tablist"][data-type="filter"] > [role="tab"]:last-child.selected {
border-right: none;
}

ul[role="tablist"][data-type="filter"] > [role="tab"].selected > a {
color: #000;
}

.hide {
display: none;
}
Expand Down

0 comments on commit b2026cc

Please sign in to comment.