Closed bluelovers closed 11 months ago
function _all_gallery_buttons() {
var _list = gradioApp().querySelectorAll('[style="display: block;"].tabitem, [style="display: flex;"] > div[id$=_results]');
var allGalleryButtons;
for (const elem of _list) {
const ret = elem.querySelectorAll('div[id$=_gallery].gradio-gallery .thumbnails > .thumbnail-item.thumbnail-small')
if (ret?.length) {
allGalleryButtons = ret;
break;
}
}
var visibleGalleryButtons = [];
allGalleryButtons?.forEach(function (elem) {
if (elem.parentElement.offsetParent)
{
visibleGalleryButtons.push(elem);
}
});
return visibleGalleryButtons;
}
function _selected_gallery_button() {
return _all_gallery_buttons().filter(elem => elem.classList.contains('selected')).pop();
}
function modalImageSwitch(offset) {
var galleryButtons = _all_gallery_buttons();
if (galleryButtons.length > 1) {
var currentButton = _selected_gallery_button();
var result = -1;
galleryButtons.forEach(function(v, i) {
if (v == currentButton) {
result = i;
}
});
if (result != -1) {
var nextButton = galleryButtons[negmod((result + offset), galleryButtons.length)];
nextButton.click();
const modalImage = gradioApp().getElementById("modalImage");
const modal = gradioApp().getElementById("lightboxModal");
modalImage.src = nextButton.children[0].src;
if (modalImage.style.display === 'none') {
modal.style.setProperty('background-image', `url(${modalImage.src})`);
}
setTimeout(function() {
modal.focus();
}, 10);
}
}
}
Since the issue was labeled with Inactive
, and no response in 30 days. This issue will be closed. If you have any questions, you can comment and reply.
由于该 issue 被标记为 Inactive,同时 30 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
💻 系统环境 | Operating System
Windows
🌐 浏览器 | Browser
Chrome
🐛 问题描述 | Bug Description
瀏覽圖片的 前後按鈕 跟 鍵盤控制 無效 無法正常切換圖片
🚦 期望结果 | Expected Behavior
No response
📷 复现步骤 | Recurrence Steps
No response
📝 补充信息 | Additional Information
No response