From dcdd162ed0bcecbed1c8286fcf21775569842e15 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Thu, 1 Sep 2016 13:15:22 +0100 Subject: [PATCH] #657 Enforce single-click navigation for mobile browsers --- .../src/components/document-list.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts index 54394d654c..8df0b3076e 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts @@ -77,7 +77,7 @@ export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, Af navigate: boolean = true; @Input() - navigationMode: string = 'dblclick'; // click|dblclick + navigationMode: string = DocumentList.DOUBLE_CLICK_NAVIGATION; // click|dblclick @Input() thumbnails: boolean = false; @@ -184,6 +184,11 @@ export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, Af this.data.thumbnails = this.thumbnails; this.data.maxItems = this.pageSize; this.contextActionHandler.subscribe(val => this.contextActionCallback(val)); + + // Automatically enforce single-click navigation for mobile browsers + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { + this.navigationMode = DocumentList.SINGLE_CLICK_NAVIGATION; + } } ngAfterContentInit() {