mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 18:59:40 +08:00
调整打开画廊不改变URL避免pjax执行重新加载
This commit is contained in:
parent
16611fce54
commit
7344bff617
@ -61,7 +61,7 @@ const commonContext = {
|
|||||||
// 用链接和标题包装图像
|
// 用链接和标题包装图像
|
||||||
$('.main-content img:not(.not-gallery)').each(function () {
|
$('.main-content img:not(.not-gallery)').each(function () {
|
||||||
if ($(this).parents('[data-fancybox],mew-photos').length === 0) {
|
if ($(this).parents('[data-fancybox],mew-photos').length === 0) {
|
||||||
$(this).wrap(`<div class="gallery-item"><div data-fancybox="gallery" ${this.alt ? `data-caption="${this.alt}"` : ''} href="${$(this).attr('src')
|
$(this).wrap(`<div class="gallery-item"><div data-fancybox="gallery" data-options='{"hash": false}' ${this.alt ? `data-caption="${this.alt}"` : ''} href="${$(this).attr('src')
|
||||||
}"></div>${(this.alt && DreamConfig.show_img_name) ? `<p>${this.alt}</p>` : ''}</div>`)
|
}"></div>${(this.alt && DreamConfig.show_img_name) ? `<p>${this.alt}</p>` : ''}</div>`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -462,7 +462,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
margins: this.getAttribute('margins') || '4'
|
margins: this.getAttribute('margins') || '4'
|
||||||
}
|
}
|
||||||
$(this).find('img').each((i, elem) => {
|
$(this).find('img').each((i, elem) => {
|
||||||
$(elem).wrap(`<div data-fancybox="gallery" ${elem.alt ? 'data-caption="' + elem.alt + '"' : ''} href="${elem.src}"></div>`)
|
$(elem).wrap(`<div data-fancybox="gallery" data-options='{"hash": false}' ${elem.alt ? 'data-caption="' + elem.alt + '"' : ''} href="${elem.src}"></div>`)
|
||||||
})
|
})
|
||||||
$(this).justifiedGallery({captions: this.options.captions, margins: this.options.margins})
|
$(this).justifiedGallery({captions: this.options.captions, margins: this.options.margins})
|
||||||
this.drawComplete()
|
this.drawComplete()
|
||||||
|
4
templates/assets/js/common.min.js
vendored
4
templates/assets/js/common.min.js
vendored
File diff suppressed because one or more lines are too long
2
templates/assets/js/mew-custom.min.js
vendored
2
templates/assets/js/mew-custom.min.js
vendored
File diff suppressed because one or more lines are too long
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="photos-gallery load-block loading">
|
<div class="photos-gallery load-block loading">
|
||||||
<div th:each="photo : ${photos.items}" th:href="${photo.spec.url}" data-fancybox="gallery" th:data-caption="${#strings.defaultString(photo.spec.description, photo.spec.displayName)}">
|
<div th:each="photo : ${photos.items}" th:href="${photo.spec.url}" data-fancybox="gallery" data-options='{"hash": false}' th:data-caption="${#strings.defaultString(photo.spec.description, photo.spec.displayName)}">
|
||||||
<img width="100%" height="100%" th:src="${photo.spec.url}"
|
<img width="100%" height="100%" th:src="${photo.spec.url}"
|
||||||
th:srcset="|${thumbnail.gen(photo.spec.url, 's')} 400w,
|
th:srcset="|${thumbnail.gen(photo.spec.url, 's')} 400w,
|
||||||
${thumbnail.gen(photo.spec.url, 'm')} 800w,
|
${thumbnail.gen(photo.spec.url, 'm')} 800w,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user