Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-07-08 18:33:50 +03:00
parent 8e6cf6e545
commit 58fb43531b

View File

@ -40,10 +40,23 @@
<script>
var setupGallery = function(gallery){
// handle clicks....
//
// NOTE: a good way to separate selection and viewing is to use
// evt.shiftKey, i.e:
// - normal click sets view mode
// - shift+click selects image
// and it would be good to implement the expected selection API:
// ctrl+a - select all
// ctrl+d - deselect all
// arrows - navigation
// shift+arrows - navigation selection
// ...
gallery.addEventListener('click', function(evt){
var target = evt.target
console.log('--- EVENT:', evt)
//console.log('--- EVENT:', evt)
if(target.tagName.toLowerCase() == 'img'){
var clicked = target