Sha256: 5ddc133fa212080a4912fe6380aa9d52e66020b642ce0e0956fcd2911767b6bb

Contents?: true

Size: 974 Bytes

Versions: 11

Compression:

Stored size: 974 Bytes

Contents

module("Event Binding");

$.each(['dropinit','dropstart','drop','dropend'],function( i, type ){
	
	test('"'+ type +'"',function(){
	
		expect( 9 );
		
		// make sure the event handler gets bound to the element
		var $elem = $('<div />'), 
		elem = $elem[0],
		count = 0,
		fn = function(){
			count += 1;
		};
		
		ok( $elem.bind( type, fn )[0] == elem, '.bind("'+ type +'", fn )' );
		ok( $.data( elem, $.event.special.drop.datakey ), "drop data exists" );
		ok( $.data( elem, "events" ), "event data exists" );
		ok( $.data( elem, "events" )[ type ][0], '"'+ type +'" event handler added' );
		
		ok( $elem.trigger( type )[0] == elem, '.trigger("'+ type +'")' );
		ok( count == 1, "handler was triggered");
		
		ok( $elem.unbind( type )[0] == elem, '.unbind("'+ type +'")' );
		ok( !$.data( elem, "events" ), "event data removed" );
		ok( !$.data( elem, $.event.special.drop.datakey ), "drop data removed" );
		
		$elem.remove();
		
	});
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bonethug-0.0.17 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.16 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.15 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.14 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.13 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.12 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.11 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.10 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.7 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.6 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js
bonethug-0.0.5 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.drop/test/binding.js