Skip to content

Commit

Permalink
another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Dec 20, 2023
1 parent e75203a commit 809154a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions resources/js/data/views/albumView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export const albumView = (Alpine: Alpine) =>
photo_layout_square_column_width: 200,
photo_layout_gap: 12,
},
isSearch: boolean = false,
): AlbumView => ({
isSearch: isSearch,
select: new Selection(albumIDs, photos, rights.can_edit),
actions: new AlbumActions(),
keybinds: new Keybindings(),
Expand Down
1 change: 1 addition & 0 deletions resources/js/data/views/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface PhotoArray {
}

export type AlbumView = AlpineComponent<{
isSearch: boolean;
select: Selection;
actions: AlbumActions;
keybinds: Keybindings;
Expand Down
5 changes: 5 additions & 0 deletions resources/js/lycheeOrg/actions/keybindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export default class Keybindings {
const url = document.getElementById("backButton")?.getAttribute("href");
// @ts-expect-error
Alpine.navigate(url);
} else if (view.isSearch) {
event.preventDefault();
const url = document.getElementById("backButton")?.getAttribute("href");
// @ts-expect-error
Alpine.navigate(url);
}
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion resources/views/livewire/pages/gallery/search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
@js($this->photosResource),
@js(null),
@js($this->overlayType),
@js($this->layouts)
@js($this->layouts),
@js(true)
)" @keydown.window="handleKeydown(event)" @popstate.window="handlePopState(event)">
<!-- toolbar -->
<x-header.bar class="opacity-0" x-bind:class="isFullscreen ? 'opacity-0 h-0' : 'opacity-100 h-14'">
Expand Down

0 comments on commit 809154a

Please sign in to comment.