Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Edsardio committed Apr 29, 2022
1 parent f93173c commit 452f0cd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
7 changes: 6 additions & 1 deletion dist/module.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ function src_default(Alpine) {
</svg>
</button>
</div>
<img class="shadow-xl" x-bind:src="$store.lightbox.src">
<img @click.away="$store.lightbox.show = false" class="shadow-xl" x-bind:src="$store.lightbox.src">
</div>
</div>
</div>
`);
document.addEventListener("keyup", (e) => {
if (e.key === "Escape") {
Alpine.store("lightbox").show = false;
}
});
Alpine.store("lightbox", {
show: false,
src: null,
Expand Down
7 changes: 6 additions & 1 deletion dist/module.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ function src_default(Alpine) {
</svg>
</button>
</div>
<img class="shadow-xl" x-bind:src="$store.lightbox.src">
<img @click.away="$store.lightbox.show = false" class="shadow-xl" x-bind:src="$store.lightbox.src">
</div>
</div>
</div>
`);
document.addEventListener("keyup", (e) => {
if (e.key === "Escape") {
Alpine.store("lightbox").show = false;
}
});
Alpine.store("lightbox", {
show: false,
src: null,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edsardio/alpine-lightbox",
"version": "1.0.4",
"version": "1.0.5",
"description": "A dynamic lightbox using AlpineJS and TailwindCSS",
"main": "dist/module.cjs.js",
"module": "dist/module.esm.js",
Expand Down
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ export default function (Alpine) {
</svg>
</button>
</div>
<img class="shadow-xl" x-bind:src="$store.lightbox.src">
<img @click.away="$store.lightbox.show = false" class="shadow-xl" x-bind:src="$store.lightbox.src">
</div>
</div>
</div>
`);

document.addEventListener('keyup', (e) => {
if (e.key === 'Escape') {
Alpine.store('lightbox').show = false;
}
})

Alpine.store('lightbox', {
show: false,
src: null,
Expand Down

0 comments on commit 452f0cd

Please sign in to comment.