Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event: fine-grained event modules #595

Closed
yiminghe opened this issue Apr 8, 2014 · 0 comments
Closed

event: fine-grained event modules #595

yiminghe opened this issue Apr 8, 2014 · 0 comments
Milestone

Comments

@yiminghe
Copy link
Member

yiminghe commented Apr 8, 2014

modules

  • event/dom => Event.on
  • event/custom -> Event.Target/Event.global
  • event/gesture/basic=> { START,MOVE,END}
  • event/gesture/pan => {PAN,PAN_START,PAN_END}
  • event/gesture/edge-pan => {EDGE_PAN,EDGE_PAN_START,EDGE_PAN_END}
  • event/gesture/pinch=> {PINCH,PINCH_START,PINCH_END}
  • event/gesture/swipe=> {SWIPE}
  • event/gesture/tap=> {TAP,HOLD,DOUBLE_TAP,SINGLE_TAP}
  • event/gesture/shake=> {SHAKE}
  • event/gesture/rotate=> {ROTATE, ROTATE_START, ROTATE_END}

example

KISSY.use(['event/dom', 'event/gesture/tap'],function(S, DomEvent, TapGesture){
    DomEvent.on(document,TapGesture.TAP,function(){
          alert('tap')
    });
});
KISSY.use(['event/dom', 'event/gesture/swipe'],function(S, DomEvent, SwipeGesture){
    DomEvent.on(document,SwipeGesture.SWIPE,{
        fn: function(e){
            // e.direction => 'left' 'right' 'up' 'down'
        },
        preventDefault: {
            // do not scroll page when swipe up or down
            down: true,
            up:true
        }
    });
});
yiminghe added a commit to yiminghe/kissy that referenced this issue Apr 8, 2014
yiminghe added a commit to yiminghe/kissy that referenced this issue Apr 10, 2014
@yiminghe yiminghe added this to the 5.0.0 milestone Apr 24, 2014
yiminghe added a commit to yiminghe/kissy that referenced this issue Jun 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant