mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Select first tab when switching out of mobile display
This commit is contained in:
		| @@ -1,8 +1,8 @@ | ||||
| import { Component, OnInit } from '@angular/core'; | ||||
| import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; | ||||
| import { FormControl, FormGroup } from '@angular/forms'; | ||||
| import { Title } from '@angular/platform-browser'; | ||||
| import { ActivatedRoute, Router } from '@angular/router'; | ||||
| import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; | ||||
| import { NgbModal, NgbNav } from '@ng-bootstrap/ng-bootstrap'; | ||||
| import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent'; | ||||
| import { PaperlessDocument } from 'src/app/data/paperless-document'; | ||||
| import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata'; | ||||
| @@ -48,6 +48,15 @@ export class DocumentDetailComponent implements OnInit { | ||||
|     tags: new FormControl([]) | ||||
|   }) | ||||
|  | ||||
|   @ViewChild('nav') nav: NgbNav | ||||
|   @ViewChild('pdfPreview') set pdfPreview(element): void { | ||||
|     // this gets called when compontent added or removed from DOM | ||||
|     if (element && element.nativeElement.offsetParent !== null) { // its visible | ||||
|  | ||||
|       setTimeout(()=> this.nav?.select(1)); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   constructor( | ||||
|     private documentsService: DocumentService, | ||||
|     private route: ActivatedRoute, | ||||
| @@ -170,4 +179,14 @@ export class DocumentDetailComponent implements OnInit { | ||||
|   hasNext() { | ||||
|     return this.documentListViewService.hasNext(this.documentId) | ||||
|   } | ||||
|  | ||||
|   previewCreated() { | ||||
|     console.log('Preview Created'); | ||||
|  | ||||
|   } | ||||
|  | ||||
|   mobilePreviewCreated() { | ||||
|     console.log('Mobile Preview Created'); | ||||
|  | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon