Panel sliding

edited November 2013 in Enyo 2
Hi,
i am using panel ,inside the panel component i am using Kind:scroller...
enyo.kind({
    kind: "Panels",
    fit: true,
    classes: "panels-sample-sliding-panels",
    style: "width:100%;",
    arrangerKind: "CollapsingArranger",
    wrap: false,
    components: [{
        name: "scroller1",
        components: [{
            kind: "Scroller",
            style: "background:white",
            classes: "enyo-fit",
            ondrag: "dragfirst"
            touch: true,
            components: [{
                name: "hpcharts",
                classes: "panels-sample-sliding-content"
            }]
        }]
    },
    {
        name: "scroller2",
        components: [{
            kind: "Scroller",
            style: "background:black",
            classes: "enyo-fit",
            ondrag: "dragsec",
            touch: true,
            components: [{
                classes: "panels-sample-sliding-content",
                content: "summaryrpt.style.display=block"
            }]
        }]
    }]
});
when i drag the scroller1 it calls the function dragfirst.
The problem i am facing it calls the function on any type of swiping.But i want to call the function only on swipe (left to right)

Thanks in advance

Comments

  • Do you need the scroller to fit all the content that's in scroller1? You can try setting horizontal:false on the scroller to tell it to only handle up/down movement. However, even with that the scroller will still catch the drag movement in its area and not pass it on to the parent element.

    What you need to do is handle the drag in the scroller, but then bubble the event up the chain so the enyo.Panels object can see it too. The Scroller has a flag, preventDragPropagation, that's normally true that keeps it from passing on any drag events up the chain. Try setting that to false and see if it lets your Panels do the right thing.
Sign In or Register to comment.