naver / egjs

Javascript components group that brings easiest and fastest way to build a web application in your way.
https://naver.github.io/egjs
Other
935 stars 80 forks source link

scrollEnd doesn't pass left/top parameters #174

Closed sculove closed 8 years ago

sculove commented 8 years ago

Description

scrollEnd event interface is weird. also, document also is wrong. http://naver.github.io/egjs/latest/doc/jQuery.html#event:scrollEnd

AS-IS

$(window).on("scrollend",function(e, p){
     p.top;
     p.left;
});

TO-BE

$(window).on("scrollend",function(e){
     e.top;
     e.left;
});
sculove commented 8 years ago

jQueryUI Style : AS-IS style

(jQuery Event, options) http://api.jqueryui.com/draggable/#event-create

Jindo : TO-BE style

(CustomEvent) http://jindo.dev.naver.com/docs/jindo-component/1.14.0/doc/external/classes/jindo.DatePicker.html#event_afterDraw

jQuery plugin, Slick, ..

http://learn.jquery.com/events/introduction-to-custom-events/ http://benalman.com/news/2010/03/jquery-special-events/

(jQuery Event, arg1, arg2, ...)

$( document ).on( "myCustomEvent", {
    foo: "bar"
}, function( event, arg1, arg2 ) {
    console.log( event.data.foo ); // "bar"
    console.log( arg1 );           // "bim"
    console.log( arg2 );           // "baz"
});
$( document ).trigger( "myCustomEvent", [ "bim", "baz" ] );
$('.your-element').on('swipe', function(event, slick, direction){
  console.log(direction);
  // left
});
mixed commented 8 years ago

jQueryUI Style

mixed commented 8 years ago

Though Persist event is Jindo style It didn`t change style. Because depricated spec.