Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exitFullscreen = () => {
if (screenfull.enabled) {
screenfull.exit();
}
};
render() {
const { children, ...props } = this.props;
const { isFullscreen } = this.state;
return functionOrMapChildren(children, {
fullscreenEnabled: screenfull.enabled,
isFullscreen,
toggleFullscreen: this.toggleFullscreen,
goFullscreen: this.goFullscreen,
exitFullscreen: this.exitFullscreen,
ref: this.setRef,
...props,
});
}
}
onFocusTimeout = setTimeout(function () {
if (socket.disconnected) socket = io()
if (screenfull.enabled) screenfull.request()
}, 0)
}
_click() {
if (screenfull.enabled) {
screenfull.toggle();
}
}
}
componentWillUnmount() {
if (screenfull.enabled) {
screenfull.off();
}
}
enableFullScreen: function() {
if (Fullscreen.enabled) {
this.state.isFullScreenSupported = true;
document.addEventListener(Fullscreen.raw.fullscreenchange, this.onFullscreenChanged.bind(this));
}
},
toggleFullscreen() {
if (screenfull.enabled) {
screenfull.toggle();
this.isFullscreen = !this.isFullscreen;
}
}
)}
<div>
{navigatorPosition === "is-aside" && }
{screenfull.enabled && (
{this.state.fullscreen ? : }
)}
</div>
);
}
onClick() {
if (screenfull.enabled) {
screenfull.toggle();
}
}
}
click() {
if (!screenfull.enabled) {
this.$message({
message: '浏览器不支持全屏',
type: 'warning'
})
return false
}
screenfull.toggle()
}
}