sel: fix mobile multi-select
Signed-off-by: Varun Patil <varunpatil@ucla.edu>pull/563/head
parent
7bb216e2b9
commit
7a316785fa
|
@ -443,16 +443,17 @@ export default defineComponent({
|
||||||
/** Multi-select triggered by touchmove */
|
/** Multi-select triggered by touchmove */
|
||||||
touchMoveSelect(touch: Touch, rowIdx: number) {
|
touchMoveSelect(touch: Touch, rowIdx: number) {
|
||||||
// Which photo is the cursor over, if any
|
// Which photo is the cursor over, if any
|
||||||
const elems = document.elementsFromPoint(touch.clientX, touch.clientY);
|
const elem: any = document
|
||||||
const photoComp: any = elems.find((e) => e.classList.contains("p-outer"));
|
.elementFromPoint(touch.clientX, touch.clientY)
|
||||||
let overPhoto: IPhoto = photoComp?.__vue__?.data;
|
?.closest(".p-outer-super");
|
||||||
|
let overPhoto: IPhoto = elem?.__vue__?.data;
|
||||||
if (overPhoto && overPhoto.flag & this.c.FLAG_PLACEHOLDER)
|
if (overPhoto && overPhoto.flag & this.c.FLAG_PLACEHOLDER)
|
||||||
overPhoto = null;
|
overPhoto = null;
|
||||||
|
|
||||||
// Do multi-selection "till" overPhoto "from" anchor
|
// Do multi-selection "till" overPhoto "from" anchor
|
||||||
// This logic is completely different from the desktop because of the
|
// This logic is completely different from the desktop because of the
|
||||||
// existence of a definitive "anchor" element. We just need to find
|
// existence of a definitive "anchor" element. We just need to find
|
||||||
// rverything between the anchor and the current photo
|
// everything between the anchor and the current photo
|
||||||
if (overPhoto && this.prevOver !== overPhoto) {
|
if (overPhoto && this.prevOver !== overPhoto) {
|
||||||
this.prevOver = overPhoto;
|
this.prevOver = overPhoto;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue