more tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-07-22 18:41:49 +03:00
parent 3c7ed59b26
commit 673912b219
2 changed files with 12 additions and 2 deletions

View File

@ -24,7 +24,10 @@
- Can we make this passive??? (i.e. CSS only)
- <s>Make more accurate -- align right side to pixel...</s>
- <s>Gallery: Spacial navigation (up/down/left/right)</s>
- <b>option: .loop_images (in porgress)</b>
- Up/Down: might be a good idea to err slightly to the left
- Gallery: PageUp/PageDown, home/end + allow page navigation
- Gallery: focus nearest visible...
- <s>Gallery/Lightbox: Selection of images (space / ctrl-a / ctrl-d / ctrl-i)</s>
- <s>Lightbox: show selection marker</s>
- <b>Gallery: constructor (list of urls)</b>

View File

@ -145,6 +145,7 @@ var Gallery = {
// options...
//
loop_images: true,
allow_row_expansion: true,
click_to_select: true,
@ -202,6 +203,7 @@ var Gallery = {
.replace(/\/[0-9]+px\//, '/') }) },
//*/
// XXX add .loop_images support...
getRow: function(img, direction='current'){
if(['above', 'current', 'below'].includes(img)){
direction = img
@ -252,6 +254,7 @@ var Gallery = {
while(e && e.tagName != 'IMG'){
e = e.previousElementSibling } }
return row },
// XXX add .loop_images support...
getImage: function(img, direction='current'){
if(['left', 'above', 'current', 'below', 'right'].includes(img)){
direction = img
@ -322,7 +325,9 @@ var Gallery = {
var row = this.getRow(cur)
var i = row.indexOf(cur) - 1
this.current = row[i < 0 ?
row.length-1
(this.loop_images ?
row.length-1
: 0)
: i]
return this },
right: function(){
@ -330,7 +335,9 @@ var Gallery = {
var row = this.getRow(cur)
var i = row.indexOf(cur) + 1
this.current = row[i >= row.length ?
0
(this.loop_images ?
0
: row.length-1)
: i]
return this },
up: function(){