🐛(layer): firefox 下 move 和 resize 异常

This commit is contained in:
sight 2022-08-03 13:24:36 +08:00
parent 4e6a77ee19
commit 7269d2d99a
2 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,8 @@ const useMove = function (el: HTMLElement, callback: Function) {
let offsetY: number;
if (el != null) {
el.addEventListener("mousedown", function (event: any) {
if (event.path[0].className === "layui-layer-title") {
const path = event.path || (event.composedPath && event.composedPath());
if (path[0].className === "layui-layer-title") {
if (event.button == 0 && el != null) {
const lexObj: any = getComputedStyle(el);
offsetX =

View File

@ -1,7 +1,8 @@
const useMove = function (el: HTMLElement, callback: Function) {
if (el != null) {
el.addEventListener("mousedown", function (event: any) {
if (event.path[0].className === "layui-layer-resize") {
const path = event.path || (event.composedPath && event.composedPath());
if (path[0].className === "layui-layer-resize") {
if (event.button == 0 && el != null) {
var x = el.offsetLeft;
var y = el.offsetTop;