myfaces.html5.slide.SlideView = function()

in myfaces-html5-core/src/main/resources/META-INF/resources/org.apache.myfaces.html5/slide.js [37:71]


    myfaces.html5.slide.SlideView = function(_root, _navigateOnArrowKeys, _navigateOnMouseWheel){
        this.slides = new Array();
        this.slideIndexes = new Array();

        for(var i=0; i<_root.children.length; i++)
        {
            var obj = _root.children[i];
            if(obj.tagName == "DIV"){
                this.slides.push(new myfaces.html5.slide.Slide(obj));
                if(obj.id){
                    this.slideIndexes[obj.id] = this.slideCount;
                }
                this.slideCount++;
            }
        }

        this.setClasses();
        myfaces.html5.effect.addEffect(_root, 'mf-slideview');

        var slideView = this;
        if(_navigateOnArrowKeys){
            document.addEventListener('keydown', function(e) { slideView.handleKeyDown(e); }, false);
        }
        if(_navigateOnMouseWheel){
            document.addEventListener('mousewheel',  function(e) { slideView.handleMouseWheel(e); }, false);
            document.addEventListener('DOMMouseScroll',  function(e) { slideView.handleMouseWheel(e); }, false);
        }


        var userAgent = navigator.userAgent;
        var opera = parseFloat(userAgent.split('Opera/')[1]) || undefined;
        if(opera)
            this.addTransition();

    };