mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Viewer enhancements and Viewer Dialog prototype (#2200)
* viewer dialog scaffold * toolbar divider component * simple error screen * material module and tooltips * show file name in the title * improved settings, simple image viewer * flex-based image viewer, minor fixes * ability to switch between viewers * single viewer for images * remove MDL from the Viewer component * remove hardcoded demo shell layout remove harcoded assumptions on "header" and "main" elements * rework text viewer, remove MDL dependency * upgrade 'unknown format' view, remove MDL * simplify media viewer layout * simplify image viewer * clean pdf viewer * migrate pdf viewer styles to scss * rewrite pdf viewer host styles in scss * fix unit tests and cleanup layout * file viewer service * viewer dialog supports downloads if url provided
This commit is contained in:
committed by
Mario Romano
parent
d460824df4
commit
bb53844f92
@@ -15,19 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:component-selector */
|
||||
|
||||
import { Component, HostListener, Input, OnChanges } from '@angular/core';
|
||||
import { Component, HostListener, Input, OnChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { LogService } from 'ng2-alfresco-core';
|
||||
import { RenderingQueueServices } from '../services/rendering-queue.services';
|
||||
|
||||
declare let PDFJS: any;
|
||||
|
||||
@Component({
|
||||
selector: 'pdf-viewer',
|
||||
selector: 'adf-pdf-viewer',
|
||||
templateUrl: './pdfViewer.component.html',
|
||||
styleUrls: ['./pdfViewer.component.css', './pdfViewerHost.component.css'],
|
||||
providers: [RenderingQueueServices]
|
||||
styleUrls: [
|
||||
'./pdfViewer.component.scss',
|
||||
'./pdfViewerHost.component.scss'
|
||||
],
|
||||
providers: [ RenderingQueueServices ],
|
||||
host: { 'class': 'adf-pdf-viewer' },
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class PdfViewerComponent implements OnChanges {
|
||||
|
||||
@@ -47,7 +50,7 @@ export class PdfViewerComponent implements OnChanges {
|
||||
page: number;
|
||||
displayPage: number;
|
||||
totalPages: number;
|
||||
laodingPercent: number;
|
||||
loadingPercent: number;
|
||||
pdfViewer: any;
|
||||
currentScaleMode: string = 'auto';
|
||||
currentScale: number;
|
||||
@@ -86,7 +89,7 @@ export class PdfViewerComponent implements OnChanges {
|
||||
|
||||
loadingTask.onProgress = (progressData) => {
|
||||
let level = progressData.loaded / progressData.total;
|
||||
this.laodingPercent = Math.round(level * 100);
|
||||
this.loadingPercent = Math.round(level * 100);
|
||||
};
|
||||
|
||||
loadingTask.then((pdfDocument) => {
|
||||
|
Reference in New Issue
Block a user