From 2221f9bff3140ade988edf7048fd33ba1adad322 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 1 Nov 2023 13:12:43 -0400 Subject: [PATCH] fix(ags players): block inputs when sliding away --- .../wim/config/ags/js/media-player/gesture.js | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/devices/wim/config/ags/js/media-player/gesture.js b/devices/wim/config/ags/js/media-player/gesture.js index bfe3973..53bf4ba 100644 --- a/devices/wim/config/ags/js/media-player/gesture.js +++ b/devices/wim/config/ags/js/media-player/gesture.js @@ -36,15 +36,19 @@ export default ({ const playerBox = overlay.list().at(-1); if (offset >= 0) { - playerBox.setStyle(`margin-left: ${offset}px; - margin-right: -${offset}px; - ${playerBox._bgStyle}`); + playerBox.setStyle(` + margin-left: ${offset}px; + margin-right: -${offset}px; + ${playerBox._bgStyle} + `); } else { const newOffset = Math.abs(offset); - playerBox.setStyle(`margin-left: -${newOffset}px; - margin-right: ${newOffset}px; - ${playerBox._bgStyle}`); + playerBox.setStyle(` + margin-left: -${newOffset}px; + margin-right: ${newOffset}px; + ${playerBox._bgStyle} + `); } overlay._selected = playerBox; }, 'drag-update'], @@ -59,24 +63,27 @@ export default ({ const playerBox = overlay.list().at(-1); if (Math.abs(offset) > MAX_OFFSET) { + widget.sensitive = false; if (offset >= 0) { - playerBox.setStyle(`${TRANSITION} - margin-left: ${OFFSCREEN}px; - margin-right: -${OFFSCREEN}px; - opacity: 0; - ${playerBox._bgStyle}`); + playerBox.setStyle(` + ${TRANSITION} + margin-left: ${OFFSCREEN}px; + margin-right: -${OFFSCREEN}px; + opacity: 0; ${playerBox._bgStyle} + `); } else { - playerBox.setStyle(`${TRANSITION} - margin-left: -${OFFSCREEN}px; - margin-right: ${OFFSCREEN}px; - opacity: 0; - ${playerBox._bgStyle}`); + playerBox.setStyle(` + ${TRANSITION} + margin-left: -${OFFSCREEN}px; + margin-right: ${OFFSCREEN}px; + opacity: 0; ${playerBox._bgStyle}`); } timeout(500, () => { overlay.reorder_overlay(playerBox, 0); playerBox.setStyle(playerBox._bgStyle); overlay._selected = overlay.list().at(-1); + widget.sensitive = true; }); } else {