Fix Bilder-Auswahl (Capture-Listener) + Mobile UX verbessern
- Selection-Click nutzt jetzt addEventListener mit capture:true auf #main, feuert garantiert VOR Poptrox und kann nicht entfernt werden - Bild-Name/Ordner als data-Attribute auf .thumb gespeichert - Mobile: Nav-Icons 1rem -> 1.3rem, bessere Touch-Targets - Mobile: Selection-Checkboxen groesser (1.8em statt 1.4em) - Mobile: Toolbar-Buttons mit mehr Padding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -182,6 +182,8 @@
|
||||
|
||||
images.forEach(function(file) {
|
||||
var article = $('<article class="thumb"></article>');
|
||||
article.attr('data-name', file.name);
|
||||
if (file.folder) article.attr('data-folder', file.folder);
|
||||
var prefix = file.folder ? encodeURIComponent(file.folder) + '/' : '';
|
||||
var fullPath = '/images/fulls/' + prefix + encodeURIComponent(file.name);
|
||||
var thumbPath = '/images/thumbs/' + prefix + encodeURIComponent(file.name);
|
||||
@@ -339,24 +341,18 @@
|
||||
$toolbar.toggleClass('visible', selectionActive);
|
||||
});
|
||||
|
||||
// Klick auf Thumbnail im Selection-Mode (direkt auf a.image, VOR poptrox gebunden)
|
||||
$main.find('.thumb a.image').on('click', function(e) {
|
||||
// Klick auf Thumbnail im Selection-Mode (Capture-Phase, feuert VOR Poptrox)
|
||||
$main[0].addEventListener('click', function(e) {
|
||||
if (!selectionActive) return;
|
||||
var thumb = e.target.closest('.thumb');
|
||||
if (!thumb) return;
|
||||
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
e.stopPropagation();
|
||||
|
||||
var $thumb = $(this).closest('.thumb');
|
||||
var $img = $thumb.find('img');
|
||||
var imgName = $img.data('name');
|
||||
var imgHref = $(this).attr('href');
|
||||
|
||||
// Ordner aus href extrahieren
|
||||
var folder = null;
|
||||
var hrefPath = imgHref.replace('/images/fulls/', '');
|
||||
var parts = hrefPath.split('/');
|
||||
if (parts.length > 1) {
|
||||
folder = decodeURIComponent(parts[0]);
|
||||
}
|
||||
var $thumb = $(thumb);
|
||||
var imgName = $thumb.attr('data-name');
|
||||
var folder = $thumb.attr('data-folder') || null;
|
||||
|
||||
var idx = -1;
|
||||
for (var i = 0; i < selectedImages.length; i++) {
|
||||
@@ -373,7 +369,7 @@
|
||||
$thumb.addClass('selected');
|
||||
}
|
||||
updateToolbar();
|
||||
});
|
||||
}, true);
|
||||
|
||||
function updateToolbar() {
|
||||
var count = selectedImages.length;
|
||||
|
||||
2
assets/js/main.min.js
vendored
2
assets/js/main.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user