Skip to content

Commit

Permalink
GH#27 fixing selection mode for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNCatz committed Apr 5, 2024
1 parent ed5e503 commit 95ab46e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
10 changes: 4 additions & 6 deletions src/DisplayObjects/MediaGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export class MediaGrid
{
plugin: GalleryTagsPlugin
mediaSearch: MediaSearch

selectMode: boolean = false;

#tempImg: string
#oldWidth: number = 0;
Expand Down Expand Up @@ -232,16 +230,16 @@ export class MediaGrid
// Mobile clicks don't seem to include shift key information
if(event.shiftKey)
{
this.selectMode = true;
this.mediaSearch.selectMode = true;
}

}, false)

document.addEventListener('keyup', async (event) =>
{
if(this.selectMode && !event.shiftKey)
if(this.mediaSearch.selectMode && !event.shiftKey)
{
this.selectMode = false;
this.mediaSearch.selectMode = false;
}

if (this.imageFocusEl.style.getPropertyValue('display') != 'block')
Expand Down Expand Up @@ -314,7 +312,7 @@ export class MediaGrid
}
}

if(Keymap.isModifier(evt as UserEvent, 'Shift') || this.selectMode)
if(Keymap.isModifier(evt as UserEvent, 'Shift') || this.mediaSearch.selectMode)
{
if(!visualEl.classList.contains("gallery-grid-vid") && !visualEl.classList.contains("gallery-grid-img"))
{
Expand Down
14 changes: 0 additions & 14 deletions src/TechnicalFiles/MediaSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,20 +360,6 @@ export class MediaSearch
this.customList = null;
}

selectElement(visualEl:(HTMLVideoElement | HTMLImageElement)): boolean
{
if(this.selectedEls.contains(visualEl))
{
this.selectedEls.remove(visualEl);
return false;
}
else
{
this.selectedEls.push(visualEl);
return true;
}
}

async #applyFilter(): Promise<void>
{
this.totalCount = 0;
Expand Down

0 comments on commit 95ab46e

Please sign in to comment.