Merge branch 'release/1.0.0' of github.com:ONLYOFFICE/AppServer into release/1.0.0
This commit is contained in:
commit
a7597a42e2
@ -109,7 +109,8 @@ class MediaViewer extends React.Component {
|
||||
_this.hammer.on("swiperight", _this.prevMedia);
|
||||
}
|
||||
} catch (ex) {
|
||||
console.error("MediaViewer updateHammer", ex);
|
||||
//console.error("MediaViewer updateHammer", ex);
|
||||
this.hammer = null;
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
@ -190,33 +191,15 @@ class MediaViewer extends React.Component {
|
||||
if (ext === ".tiff" || ext === ".tif") {
|
||||
this.getTiffDataURL(src);
|
||||
}
|
||||
var _this = this;
|
||||
setTimeout(function () {
|
||||
if (document.getElementsByClassName("react-viewer-canvas").length > 0) {
|
||||
_this.hammer = Hammer(
|
||||
document.getElementsByClassName("react-viewer-canvas")[0]
|
||||
);
|
||||
var pinch = new Hammer.Pinch();
|
||||
_this.hammer.add([pinch]);
|
||||
_this.hammer.on("pinchout", _this.handleZoomOut);
|
||||
_this.hammer.on("pinchin", _this.handleZoomIn);
|
||||
_this.hammer.on("pinchend", _this.handleZoomEnd);
|
||||
_this.hammer.on("doubletap", _this.doubleTap);
|
||||
} else {
|
||||
_this.hammer = Hammer(
|
||||
document.getElementsByClassName("videoViewerOverlay")[0]
|
||||
);
|
||||
}
|
||||
if (_this.hammer) {
|
||||
_this.hammer.on("swipeleft", _this.nextMedia);
|
||||
_this.hammer.on("swiperight", _this.prevMedia);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
this.updateHammer();
|
||||
|
||||
document.addEventListener("keydown", this.onKeydown, false);
|
||||
document.addEventListener("keyup", this.onKeyup, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
console.log("unmount mediaviewer");
|
||||
if (this.hammer) {
|
||||
this.hammer.off("swipeleft", this.nextMedia);
|
||||
this.hammer.off("swiperight", this.prevMedia);
|
||||
@ -227,6 +210,7 @@ class MediaViewer extends React.Component {
|
||||
}
|
||||
document.removeEventListener("keydown", this.onKeydown, false);
|
||||
document.removeEventListener("keyup", this.onKeyup, false);
|
||||
this.onClose();
|
||||
}
|
||||
|
||||
mapSupplied = {
|
||||
|
Loading…
Reference in New Issue
Block a user