Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit 38ce3d3

Browse files
Adding getter to retrieve the lightGallery instance
1 parent b511232 commit 38ce3d3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Added
1212

1313
- Support for Stimulus 2.0
14+
- Adding getter to retrieve the lightGallery instance
1415

1516
### Changed
1617

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export default class extends Controller {
1313
})
1414
}
1515

16+
get lightGallery () {
17+
return window.lgData[this.element.getAttribute('lg-uid')]
18+
}
19+
1620
get defaultOptions () {
1721
return {}
1822
}

0 commit comments

Comments
 (0)