From dc48781d3c6b2c304c4cc50d6c02f15fd70757f0 Mon Sep 17 00:00:00 2001 From: LIN HONG Date: Fri, 8 Oct 2021 15:27:10 +0800 Subject: [PATCH] fix: viewer --- source/javascripts/custom.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/javascripts/custom.js b/source/javascripts/custom.js index 2220e85..acff5d9 100644 --- a/source/javascripts/custom.js +++ b/source/javascripts/custom.js @@ -218,9 +218,6 @@ import { addNewClass, removeClass, throttle } from './class-module' next: true, }, keyboard: false, - url(image) { - return image.dataset.original - }, } const galleryViewer = $('.article-gallery') if (galleryViewer && galleryViewer.length > 0) { @@ -232,7 +229,15 @@ import { addNewClass, removeClass, throttle } from './class-module' } const photographyViewer = $('.photography-item') if (photographyViewer && photographyViewer.length > 0) { - photographyViewer.viewer(viewerConfig) + const temp = Object.assign( + { + url(image) { + return image.dataset.original + }, + }, + viewerConfig + ) + photographyViewer.viewer(temp) } // Plyr