Create Photoswipe escape class

* Set 'rx-escape' as a escape class for images to escape photoswipe addon.
* `rx-escape` 라는 class 를 가진 이미지는 포토스와이프 애드온으로 포토스와이프 되지 않습니다.
This commit is contained in:
MinSoo Kim 2016-07-18 01:56:11 +09:00 committed by GitHub
parent f7736dbc29
commit da3e971486

View file

@ -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);