added click to select option...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b8a0146d63
commit
f869066082
@ -143,6 +143,7 @@ var keyboard = {
|
||||
var Gallery = {
|
||||
|
||||
allow_row_expansion: true,
|
||||
click_to_select: true,
|
||||
|
||||
code: `
|
||||
<div class="gallery">
|
||||
@ -405,8 +406,15 @@ var Gallery = {
|
||||
.addEventListener('click', function(evt){
|
||||
var target = evt.target
|
||||
if(target.tagName == 'IMG'){
|
||||
that.current = target
|
||||
that.show() } })
|
||||
// first click selects, second shows...
|
||||
if(that.click_to_select){
|
||||
target.classList.contains('current') ?
|
||||
that.show()
|
||||
: (that.current = target)
|
||||
// first click selects and shows...
|
||||
} else {
|
||||
that.current = target
|
||||
that.show() } } })
|
||||
|
||||
// handle resizing...
|
||||
new ResizeObserver(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user