Open martindholmes opened 4 years ago
An additional note: when this is done, we could also add some code that runs when an image is selected, where if the picture element is being used, and a funcFolderToLarge function has been provided, an additional source element is added to the picture, causing the load of the large version of the image, which would presumably then be used when zooming. This would need some experimentation, but if it works, it would provide a system which uses thumbnails for the main listing, medium-sized images for initial selection, and large options when needed.
And when closing an image, the reset function should be run to unrotate and unzoom it.
This work is taking place in branch issue_6.
Working through the implications here:
So: new persistent properties: selectedItem (string id) exSelectedItem (string id)
New methods: setSelected() unsetSelected()
new CSS classes: fvSelected (repurpose existing :target rulesets) fvExSelected (just outlined somehow)
Once this is all working, we need to add the code to manipulate the History so that the back and forward buttons will move through selections. That'll need a bit more thought.
This is a large-scale change, but it really reflects the way this codebase has moved from a simple CSS-based thing to a more sophisticated tool that's completely JS-dependent.
The current dependency on setting the target to a specific image container to "select" it should be replaced with a JavaScript call which sets a class on it, removing that class from the last image that had it, if any. This would also enable the image to be reset to normal size and orientation at the same time, removing the odd situation where you can leave an image in a rotated or enlarged state and it retains that change even when it's no longer the focus, just an item in the list of thumbnails.
However, we do want to retain the location-hash functionality for the sake of bookmarking specific images, which means that: