Sha256: 1dd30afc4f6d5192b1f78805fe23e06658710e322b7eec8890d31ca7a42f55e8

Contents?: true

Size: 1.28 KB

Versions: 11

Compression:

Stored size: 1.28 KB

Contents

module("Linger Method");
	
$.each(['start','','end'],function( i, type ){

	test('"linger'+ type +'"',function(){
	
		expect( 11 );
		
		// make sure the event handler gets bound to the element
		var $elem = $('<div />'), 
		elem = $elem[0],
		count = 0,
		fn = function(){
			count += 1;
		},
		opts = {
			speed: 111,
			delay: 222,
			persist: 333
		},
		data;
		
		ok( $elem.linger( type, fn )[0] == elem, ".linger("+( type ? "'"+ type +"'," : "" )+" fn )" );
		ok( $.data( elem, $.event.special.linger.datakey ), "linger data exists" );
		ok( $.data( elem, "events" ), "event data exists" );
		ok( $.data( elem, "events" )[ 'linger'+type ][0], 'linger'+ type +" event handler added" );
		
		ok( $elem.linger( type )[0] == elem, ".linger("+( type ? "'"+ type +"'" : "" )+")" );
		ok( count == 1, "handler was triggered");
		
		$elem.unbind( type );
		
		ok( $elem.linger( type, fn, opts )[0] == elem, ".linger("+( type ? "'"+ type +"'," : "" )+" fn, opts )" );
		ok( data = $.data( elem, $.event.special.linger.datakey ), "linger data exists" );
		
		ok( data.speed == opts.speed, "'speed' option stored" );
		ok( data.delay == opts.delay, "'delay' option stored" );
		ok( data.persist == opts.persist, "'persist' option stored" );
		
		$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.linger/test/method.js
bonethug-0.0.16 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.15 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.14 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.13 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.12 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.11 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.10 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.7 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.6 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js
bonethug-0.0.5 skel/project_types/silverstripe3/public/abc/javascript/library/jQuery/event.linger/test/method.js