(e)
| 27085 | |
| 27086 | var checkFloatBarTimer, initMouse = false, composedTarget, checking = false, target, type, clientX, clientY, altKey; |
| 27087 | function globalMouseoverHandler(e) { |
| 27088 | if (galleryMode) return;//库模式全屏中...... |
| 27089 | if (e.target == ImgWindowC.overlayer) return; |
| 27090 | let canPreview = checkPreview(e); |
| 27091 | if (e.type == "mousemove") { |
| 27092 | if (!initMouse) { |
| 27093 | initMouse = true; |
| 27094 | return; |
| 27095 | } |
| 27096 | if ((uniqueImgWin && !uniqueImgWin.removed && !uniqueImgWin.previewed)) { |
| 27097 | if (canPreview || prefs.floatBar.globalkeys.invertInitShow) { |
| 27098 | uniqueImgWinInitX = e.clientX; |
| 27099 | uniqueImgWinInitY = e.clientY; |
| 27100 | uniqueImgWin.followPos(uniqueImgWinInitX, uniqueImgWinInitY); |
| 27101 | } else { |
| 27102 | uniqueImgWin.remove(); |
| 27103 | } |
| 27104 | return; |
| 27105 | } else { |
| 27106 | if (checking) { |
| 27107 | setTimeout(() => { |
| 27108 | checking = false; |
| 27109 | }, 50); |
| 27110 | return; |
| 27111 | } |
| 27112 | checking = true; |
| 27113 | if (!canPreview) return; |
| 27114 | let target = e.target; |
| 27115 | if (target.nodeName == "PICTURE"){ |
| 27116 | target = target.lastElementChild || target; |
| 27117 | } |
| 27118 | if (target.nodeName != 'IMG') return; |
| 27119 | } |
| 27120 | } |
| 27121 | if (!initMouse) return; |
| 27122 | if (e.type == "keydown") { |
| 27123 | if (!target) return; |
| 27124 | } else { |
| 27125 | target = e.target; |
| 27126 | type = e.type; |
| 27127 | clientX = e.clientX; |
| 27128 | clientY = e.clientY; |
| 27129 | altKey = e.altKey; |
| 27130 | if (e.type !== "mousemove") { |
| 27131 | let path = e && e.composedPath && e.composedPath(); |
| 27132 | composedTarget = path && path[0]; |
| 27133 | } |
| 27134 | } |
| 27135 | clearTimeout(checkFloatBarTimer); |
| 27136 | checkFloatBarTimer = setTimeout(function() { |
| 27137 | if (!target || !target.parentNode) return; |
| 27138 | if (gallery && gallery.shown) return; |
| 27139 | checkFloatBar(target, type, canPreview, clientX, clientY, altKey, composedTarget); |
| 27140 | }, 50); |
| 27141 | if (e.target.shadowRoot) { |
| 27142 | if (!e.target.shadowRoot.initListener) { |
| 27143 | e.target.shadowRoot.initListener = true; |
| 27144 | e.target.shadowRoot.addEventListener('mouseenter', (e) => { |
no test coverage detected