This commit is contained in:
hutchwhite 2017-03-24 11:11:09 -07:00
Родитель 29e1f0fa61
Коммит 6d55b504f1
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -358,7 +358,7 @@ export class FocusService {
* Updates the selected DOM node.
*/
public selectNode(next: HTMLElement, scrollSpeed: number) {
const { selected, parents } = this;
const { selected } = this;
if (selected === next) {
return;
}
@ -366,9 +366,9 @@ export class FocusService {
this.rescroll(next, scrollSpeed, this.root);
const attached = selected && isNodeAttached(selected, this.root);
if (!attached && parents) {
parents.forEach(parent => parent.classList.remove(cssClass.selected));
}
// if (!attached && parents) {
// parents.forEach(parent => parent.classList.remove(cssClass.selected));
// }
this.parents = [];
@ -382,11 +382,11 @@ export class FocusService {
const common = getCommonAncestor(next, selected);
selected.classList.remove(cssClass.direct);
for (let el = selected; el !== common && el; el = el.parentElement) {
el.classList.remove(cssClass.selected);
//el.classList.remove(cssClass.selected);
this.triggerFocusChange(el, null);
}
for (let el = next; el !== common && el; el = el.parentElement) {
el.classList.add(cssClass.selected);
//el.classList.add(cssClass.selected);
this.triggerFocusChange(el, next);
this.parents.push(el);
}
@ -398,7 +398,7 @@ export class FocusService {
// Trigger focus changes and add selected classes everywhere
// from the target element to the root.
for (let el = next; el !== this.root && el; el = el.parentElement) {
el.classList.add(cssClass.selected);
//el.classList.add(cssClass.selected);
this.triggerFocusChange(el, next);
this.parents.push(el);
}