|
@@ -249,12 +249,12 @@ export class BaseViewport extends ViewportEventTarget implements Viewport
|
249
|
249
|
if(container === (document as any).webkitFullscreenElement)
|
250
|
250
|
resolve();
|
251
|
251
|
else
|
252
|
|
- reject(new AccessDeniedError());
|
|
252
|
+ reject(new TypeError());
|
253
|
253
|
}, 100);
|
254
|
254
|
});
|
255
|
255
|
}
|
256
|
256
|
|
257
|
|
- // check if fullscreen is supported
|
|
257
|
+ // check if the fullscreen mode is available
|
258
|
258
|
if(!document.fullscreenEnabled)
|
259
|
259
|
return Speedy.Promise.reject(new AccessDeniedError());
|
260
|
260
|
|
|
@@ -278,7 +278,7 @@ export class BaseViewport extends ViewportEventTarget implements Viewport
|
278
|
278
|
if(doc.webkitExitFullscreen === undefined)
|
279
|
279
|
return Speedy.Promise.reject(new NotSupportedError());
|
280
|
280
|
else if(doc.webkitFullscreenElement === null)
|
281
|
|
- return Speedy.Promise.reject(new TypeError('Not in fullscreen mode'));
|
|
281
|
+ return Speedy.Promise.reject(new IllegalOperationError('Not in fullscreen mode'));
|
282
|
282
|
|
283
|
283
|
// webkitExitFullscreen() does not return a value
|
284
|
284
|
doc.webkitExitFullscreen();
|
|
@@ -656,7 +656,7 @@ abstract class ViewportDecorator extends ViewportEventTarget implements Viewport
|
656
|
656
|
*/
|
657
|
657
|
isFullscreenAvailable(): boolean
|
658
|
658
|
{
|
659
|
|
- return this._base.fullscreenAvailable;
|
|
659
|
+ return this._base.isFullscreenAvailable();
|
660
|
660
|
}
|
661
|
661
|
|
662
|
662
|
/**
|
|
@@ -758,9 +758,6 @@ abstract class ResizableViewport extends ViewportDecorator
|
758
|
758
|
super._init();
|
759
|
759
|
this._active = true;
|
760
|
760
|
|
761
|
|
- // bound resize
|
762
|
|
- const resize = this._resize.bind(this);
|
763
|
|
-
|
764
|
761
|
// Configure the resize listener. We want the viewport
|
765
|
762
|
// to adjust itself if the phone/screen is resized or
|
766
|
763
|
// changes orientation
|
|
@@ -776,7 +773,7 @@ abstract class ResizableViewport extends ViewportDecorator
|
776
|
773
|
|
777
|
774
|
timeout = setTimeout(() => {
|
778
|
775
|
timeout = null;
|
779
|
|
- resize();
|
|
776
|
+ this._resize();
|
780
|
777
|
}, 50);
|
781
|
778
|
};
|
782
|
779
|
window.addEventListener('resize', onWindowResize);
|
|
@@ -784,12 +781,12 @@ abstract class ResizableViewport extends ViewportDecorator
|
784
|
781
|
// handle changes of orientation
|
785
|
782
|
// (is this needed? we already listen to resize events)
|
786
|
783
|
if(screen.orientation !== undefined)
|
787
|
|
- screen.orientation.addEventListener('change', resize);
|
|
784
|
+ screen.orientation.addEventListener('change', this._resize.bind(this));
|
788
|
785
|
else
|
789
|
|
- window.addEventListener('orientationchange', resize); // deprecated
|
|
786
|
+ window.addEventListener('orientationchange', this._resize.bind(this)); // deprecated
|
790
|
787
|
|
791
|
788
|
// trigger a resize to setup the sizes / the CSS
|
792
|
|
- resize();
|
|
789
|
+ this._resize();
|
793
|
790
|
}
|
794
|
791
|
|
795
|
792
|
/**
|