From da3e9714868e4282f6a621e263aba06de155b7cf Mon Sep 17 00:00:00 2001 From: MinSoo Kim Date: Mon, 18 Jul 2016 01:56:11 +0900 Subject: [PATCH] Create Photoswipe escape class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Set 'rx-escape' as a escape class for images to escape photoswipe addon. * `rx-escape` 라는 class 를 가진 이미지는 포토스와이프 애드온으로 포토스와이프 되지 않습니다. --- addons/photoswipe/rx_photoswipe.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/photoswipe/rx_photoswipe.js b/addons/photoswipe/rx_photoswipe.js index 4dbf8bf7c..6e7b177e8 100644 --- a/addons/photoswipe/rx_photoswipe.js +++ b/addons/photoswipe/rx_photoswipe.js @@ -217,8 +217,13 @@ var initPhotoSwipeFromDOM = function(gallerySelector) { // do not activate PhotoSwipe at the editor-component or other module components var regx_skip = /(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i; var regx_allow_i6pngfix = /(?:common\/tpl\/images\/blank\.gif$)/i; + var ps_skip_class = 'rx-escape'; var galleryImgEls = $(galleryElements[i]).find('img'); for(var j = 0, jl = galleryImgEls.length; j < jl; j++) { + // if the item has skip class, skip it. + if($(galleryImgEls[j]).hasClass(ps_skip_class)) continue; + + // skip components if(regx_skip.test($(galleryImgEls[j]).attr('src')) && !regx_allow_i6pngfix.test($(galleryImgEls[j]).attr('src'))) continue; //$(galleryImgEls[j]).attr('data-pswp-uid', i+1);