From 53dc950093501d4cd7f3c21d1d1f917326dc869a Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 14 Dec 2021 14:25:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=A5=BF=E5=AE=89=E4=B8=80?= =?UTF-8?q?=E4=B8=89=E5=8F=B7=E7=BA=BF=20=E6=8A=98=E8=BF=94=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/xian_01.js | 4 +- src/utils/screen.js | 58 +++++++++++++------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index 1145f8514..bad6a642d 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -271,8 +271,8 @@ class SkinCode extends defaultStyle { mergentR:4, // 站台折返策略边数 position: 0, // 折返方向 offset: {x: -16, y: -15}, // 折返偏移量 - noHumanColor: '#0F16DA', // 站台无人折返 - autoChangeEndsColor: '#0BF400' // 站台自动换端 + noHumanColor: '#0BF400', // 站台无人折返 + autoChangeEndsColor: '#0F16DA' // 站台自动换端 }, common: { // 通用属性 diff --git a/src/utils/screen.js b/src/utils/screen.js index 15a035cad..ac93e7b77 100644 --- a/src/utils/screen.js +++ b/src/utils/screen.js @@ -1,6 +1,6 @@ // 判断全屏模式是否是可用 export function isFullscreenEnabled() { - return document.fullscreenEnabled || + return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled || false; @@ -8,7 +8,7 @@ export function isFullscreenEnabled() { // 判断浏览器是否全屏 export function isFullscreen() { - return document.fullscreenElement || + return document.fullscreenElement || document.msFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || false; @@ -16,36 +16,36 @@ export function isFullscreen() { // 启动全屏 export function launchFullscreen() { - if (isFullscreenEnabled()) { - const element = document.documentElement; - if (element.requestFullScreen) { - element.requestFullScreen(); - } else if (element.mozRequestFullScreen) { - element.mozRequestFullScreen(); - } else if (element.msRequestFullscreen) { - element.msRequestFullscreen(); - } else if (element.oRequestFullscreen) { - element.oRequestFullscreen(); - } else if (element.webkitRequestFullScreen) { - element.webkitRequestFullScreen(); - } - } + if (isFullscreenEnabled()) { + const element = document.documentElement; + if (element.requestFullScreen) { + element.requestFullScreen(); + } else if (element.mozRequestFullScreen) { + element.mozRequestFullScreen(); + } else if (element.msRequestFullscreen) { + element.msRequestFullscreen(); + } else if (element.oRequestFullscreen) { + element.oRequestFullscreen(); + } else if (element.webkitRequestFullScreen) { + element.webkitRequestFullScreen(); + } + } } // 退出全屏 export function exitFullscreen() { - if (isFullscreen()) { - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.mozExitFullScreen) { - document.mozExitFullScreen(); - } else if (document.webkitExitFullscreen) { - document.webkitExitFullscreen(); - } - } + if (isFullscreen()) { + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.mozExitFullScreen) { + document.mozExitFullScreen(); + } else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } + } }