Loading src/webedit/slider/slider.cpp +4 −2 Changes for src/webedit/slider/slider.cpp: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -477,10 +477,12 @@ extern "C" { js << "function next(){show(cur+1);}"; js << "function prev(){show(cur-1);}"; js << "function goTo(i){show(i);}"; js << "function stopAuto(){if(timer){clearInterval(timer);timer=null;}}"; js << "function startAuto(){"; js << " if(timer)clearInterval(timer);"; js << " timer=setInterval(next," << interval << ");"; js << "}"; js << "el.addEventListener('click',function(){stopAuto();});"; js << "show(0);"; if (autoplay && slideCount > 1) { js << "startAuto();"; Loading @@ -507,11 +509,11 @@ extern "C" { js << " var dy=e.changedTouches[0].clientY-ty;"; js << " if(Math.abs(dx)>Math.abs(dy)&&Math.abs(dx)>30){"; js << " if(dx<0)next();else prev();"; js << " if(timer){clearInterval(timer);startAuto();}"; js << " stopAuto();"; js << " }"; js << "},{passive:true});"; js << "el.addEventListener('touchcancel',function(){moving=false;},{passive:true});"; js << "el._blogiSlider={next:next,prev:prev,goTo:goTo};"; js << "el._blogiSlider={next:next,prev:prev,goTo:goTo,stopAuto:stopAuto,startAuto:startAuto};"; js << "})();"; script.appendChild(libhtmlpp::TextElement(js.str().c_str())); el.appendChild(script); Loading Loading
src/webedit/slider/slider.cpp +4 −2 Changes for src/webedit/slider/slider.cpp: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -477,10 +477,12 @@ extern "C" { js << "function next(){show(cur+1);}"; js << "function prev(){show(cur-1);}"; js << "function goTo(i){show(i);}"; js << "function stopAuto(){if(timer){clearInterval(timer);timer=null;}}"; js << "function startAuto(){"; js << " if(timer)clearInterval(timer);"; js << " timer=setInterval(next," << interval << ");"; js << "}"; js << "el.addEventListener('click',function(){stopAuto();});"; js << "show(0);"; if (autoplay && slideCount > 1) { js << "startAuto();"; Loading @@ -507,11 +509,11 @@ extern "C" { js << " var dy=e.changedTouches[0].clientY-ty;"; js << " if(Math.abs(dx)>Math.abs(dy)&&Math.abs(dx)>30){"; js << " if(dx<0)next();else prev();"; js << " if(timer){clearInterval(timer);startAuto();}"; js << " stopAuto();"; js << " }"; js << "},{passive:true});"; js << "el.addEventListener('touchcancel',function(){moving=false;},{passive:true});"; js << "el._blogiSlider={next:next,prev:prev,goTo:goTo};"; js << "el._blogiSlider={next:next,prev:prev,goTo:goTo,stopAuto:stopAuto,startAuto:startAuto};"; js << "})();"; script.appendChild(libhtmlpp::TextElement(js.str().c_str())); el.appendChild(script); Loading