{"version":3,"file":"post_show_slide_show.js","mappings":"AAEAA,EAAE,gBAAgBC,GAAG,SAAS,SAASC,GACrC,IAAIC,EAAcH,EAAEE,EAAEE,QACtBJ,EAAE,gBAAgBK,OAAOF,EAAYG,QAAQC,cAAcC,SAAS,gBAAgBC,IAAI,UAAW,QACnGT,EAAE,gBAAgBK,OAAOL,EAAE,mBAC3BA,EAAE,gBAAgBU,QAAQV,EAAE,gBAC5BA,EAAE,SAASW,MACb,IAGAX,EAAE,gBAAgBC,GAAG,SAAS,SAASC,GACrCF,EAAE,gBAAgBY,SAClBZ,EAAE,gBAAgBW,OAClBX,EAAE,gBAAgBW,OAClBX,EAAE,SAASa,MACb,IAGAb,EAAE,kBAAkBC,GAAG,SAAS,SAASC,GACvCA,EAAEY,kBACF,IAAIX,EAAcH,EAAEE,EAAEE,QAAQW,SAAS,gBAAgBC,QACnDC,EAAed,EAAYe,KAAK,cAChCC,EAAWnB,EAAE,gBAAgBoB,OAAOH,GAAgB,OAAOX,QAE3Da,EAASE,OAAS,IACpBF,EAAWnB,EAAE,oBAAoBM,SAEnCH,EAAYmB,YAAYH,EAASZ,cAAcC,SAAS,eAC1D,IAGAR,EAAE,eAAeC,GAAG,SAAS,SAASC,GACpCA,EAAEY,kBACF,IAAIX,EAAcH,EAAEE,EAAEE,QAAQW,SAAS,gBAAgBC,QACnDC,EAAed,EAAYe,KAAK,cAChCK,EAAWvB,EAAE,gBAAgBoB,OAAOH,GAAgB,OAAOX,QAE/D,GAAIiB,EAASF,OAAS,EAAG,CACvB,IAAIG,EAAcxB,EAAE,gBAAgByB,KAAI,WACtC,OAAOL,OAAOpB,EAAE0B,MAAMC,KAAK,SAC7B,IAEIC,EAAaC,KAAKC,IAAIC,MAAMF,KAAML,GACtCD,EAAWvB,EAAE,gBAAgB4B,OAAgBtB,OAC/C,CACAH,EAAYmB,YAAYC,EAAShB,cAAcC,SAAS,eAC1D","sources":["webpack://trace_taiwan/./app/javascript/packs/post_show_slide_show.js"],"sourcesContent":["\n// Enlarge photos when clicked\n$('.trace-photo').on('click', function(e) {\n let $currentImg = $(e.target);\n $('#modal-layer').append($currentImg.clone().removeClass().addClass('current-img')).css('display', 'flex');\n $(\"#modal-layer\").append($('.forward-arrow'));\n $(\"#modal-layer\").prepend($('.back-arrow'));\n $(\".back\").hide();\n})\n\n// Return to main page when clicking away from photos\n$('#modal-layer').on('click', function(e) {\n $('.current-img').remove();\n $('.image-modal').hide();\n $('#modal-layer').hide();\n $(\".back\").show();\n})\n\n// Clicking forward arrow will go to next photo, wraps around if end of photos\n$('.forward-arrow').on('click', function(e) {\n e.stopPropagation();\n let $currentImg = $(e.target).siblings('.current-img').first();\n let currentIndex = $currentImg.attr('data-index');\n let $nextImg = $(`[data-index=\"${Number(currentIndex) + 1}\"]`).clone();\n\n if ($nextImg.length < 1) {\n $nextImg = $(`[data-index=\"0\"]`).clone();\n }\n $currentImg.replaceWith($nextImg.removeClass().addClass('current-img'));\n})\n\n// Clicking back arrow will go to next photo, wraps around if end of photos\n$('.back-arrow').on('click', function(e) {\n e.stopPropagation();\n let $currentImg = $(e.target).siblings('.current-img').first();\n let currentIndex = $currentImg.attr('data-index');\n let $prevImg = $(`[data-index=\"${Number(currentIndex) - 1}\"]`).clone();\n\n if ($prevImg.length < 1) {\n let photoIndexs = $('.trace-photo').map(function() {\n return Number($(this).data('index'));\n })\n\n let finalIndex = Math.max.apply(Math, photoIndexs)\n $prevImg = $(`[data-index=\"${finalIndex}\"]`).clone();\n }\n $currentImg.replaceWith($prevImg.removeClass().addClass('current-img'));\n})"],"names":["$","on","e","$currentImg","target","append","clone","removeClass","addClass","css","prepend","hide","remove","show","stopPropagation","siblings","first","currentIndex","attr","$nextImg","Number","length","replaceWith","$prevImg","photoIndexs","map","this","data","finalIndex","Math","max","apply"],"sourceRoot":""}