Commit a4962931 authored by jan.koester's avatar jan.koester
Browse files

test

parent 16c080db
Loading
Loading
Loading
Loading
+5 −2
Changes for src/webedit/slider/slider.cpp: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -459,6 +459,9 @@ extern "C" {
                    js << "var slides=el.querySelectorAll('." << cls << "-slide');";
                    js << "var dots=el.querySelectorAll('." << cls << "-dots button');";
                    js << "var n=slides.length,cur=0,timer=null;";
                    // Set slide widths in pixels for reliable mobile rendering
                    js << "function setSizes(){var w=el.offsetWidth;for(var j=0;j<n;j++)slides[j].style.minWidth=w+'px';}";
                    js << "setSizes();";
                    js << "function show(i){";
                    js << "  cur=((i%n)+n)%n;";
                    if (transition == "fade") {
@@ -482,8 +485,8 @@ extern "C" {
                    if (autoplay && slideCount > 1) {
                        js << "startAuto();";
                    }
                    // Recalculate position on resize/orientation change
                    js << "window.addEventListener('resize',function(){show(cur);});";
                    // Recalculate sizes and position on resize/orientation change
                    js << "window.addEventListener('resize',function(){setSizes();show(cur);});";
                    // Touch/swipe support for mobile
                    js << "el.querySelectorAll('img,video,a,div,span,p,h1,h2,h3,h4,button').forEach(function(m){m.style.touchAction='pan-y';m.draggable=false;m.style.webkitUserDrag='none';m.style.userSelect='none';});";
                    js << "var tx=0,ty=0,moving=false;";