File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -145,14 +145,21 @@ class BaseViewer {
145
145
this . viewer = options . viewer || options . container . firstElementChild ;
146
146
147
147
if (
148
- ( typeof PDFJSDev === "undefined" ||
149
- PDFJSDev . test ( "!PRODUCTION || GENERIC" ) ) &&
150
- ! (
151
- this . container instanceof HTMLDivElement &&
152
- this . viewer instanceof HTMLDivElement
153
- )
148
+ typeof PDFJSDev === "undefined" ||
149
+ PDFJSDev . test ( "!PRODUCTION || GENERIC" )
154
150
) {
155
- throw new Error ( "Invalid `container` and/or `viewer` option." ) ;
151
+ if (
152
+ ! (
153
+ this . container instanceof HTMLDivElement &&
154
+ this . viewer instanceof HTMLDivElement
155
+ )
156
+ ) {
157
+ throw new Error ( "Invalid `container` and/or `viewer` option." ) ;
158
+ }
159
+
160
+ if ( getComputedStyle ( this . container ) . position !== "absolute" ) {
161
+ throw new Error ( "The `container` must be absolutely positioned." ) ;
162
+ }
156
163
}
157
164
this . eventBus = options . eventBus ;
158
165
this . linkService = options . linkService || new SimpleLinkService ( ) ;
You can’t perform that action at this time.
0 commit comments