added flag for enable RayTrace finder (#58)

* added feature flag for enable Raycast focus finder
This commit is contained in:
saadataz 2017-04-18 13:33:43 -07:00 коммит произвёл GitHub
Родитель 3add8517ed
Коммит 095876959f
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -234,6 +234,7 @@ function isNodeAttached(node: HTMLElement, root: HTMLElement) {
@Injectable()
export class FocusService {
public enableRaycast = true;
// Focus root, the service operates below here.
private root: HTMLElement;
public focusRoot: HTMLElement = defaultFocusRoot;
@ -382,7 +383,9 @@ export class FocusService {
const directional = isDirectional(direction);
let element: HTMLElement;
if (directional) {
element = this.findNextFocusByRaycast(direction);
if (this.enableRaycast) {
element = this.findNextFocusByRaycast(direction);
}
if (!element) {
element = this.findNextFocus(direction);
}