@@ -52,10 +52,10 @@ Class.create("PDFJSViewer", AbstractEditor, {
52
52
var pdfurl = encodeURIComponent ( url + '/' + ajxpBootstrap . parameters . get ( 'ajxpServerAccess' ) + '&action=get_content&file=' + fileName ) ;
53
53
54
54
// Hide the Pydio action bar.
55
- this . element . getElementsByClassName ( ' editor_action_bar') [ 0 ] . style . display = 'none' ;
55
+ this . element . down ( '. editor_action_bar') . setStyle ( { display : 'none' } ) ;
56
56
57
57
// Set up the main container and load the PDF file.
58
- this . contentMainContainer = this . element . getElementsByTagName ( 'iframe' ) [ 0 ] ;
58
+ this . contentMainContainer = this . element . down ( 'iframe' ) ;
59
59
this . contentMainContainer . src = 'plugins/editor.pdfjs/pdfjs/web/viewer.html?file=' + pdfurl ;
60
60
61
61
this . contentMainContainer . observe ( "focus" , function ( ) {
@@ -67,5 +67,27 @@ Class.create("PDFJSViewer", AbstractEditor, {
67
67
68
68
// Set the tab label.
69
69
this . updateTitle ( getBaseName ( fileName ) ) ;
70
- }
70
+
71
+ } ,
72
+ resize : function ( size ) {
73
+ if ( size ) {
74
+ this . contentMainContainer . setStyle ( { height :size + 'px' } ) ;
75
+ if ( this . IEorigWidth ) this . contentMainContainer . setStyle ( { width :this . IEorigWidth } ) ;
76
+ } else {
77
+ if ( this . fullScreenMode ) {
78
+ fitHeightToBottom ( this . contentMainContainer , this . element ) ;
79
+ if ( this . IEorigWidth ) this . contentMainContainer . setStyle ( { width :this . element . getWidth ( ) } ) ;
80
+ } else {
81
+ if ( this . editorOptions . context . elementName ) {
82
+ fitHeightToBottom ( this . contentMainContainer , $ ( this . editorOptions . context . elementName ) , 5 ) ;
83
+ } else {
84
+ fitHeightToBottom ( $ ( this . element ) ) ;
85
+ fitHeightToBottom ( $ ( this . contentMainContainer ) , $ ( this . element ) ) ;
86
+ }
87
+ if ( this . IEorigWidth ) this . contentMainContainer . setStyle ( { width :this . IEorigWidth } ) ;
88
+ }
89
+ }
90
+ this . element . fire ( "editor:resize" , size ) ;
91
+ }
92
+
71
93
} ) ;
0 commit comments