Sha256: 407faee3629252b6164e84aa5f66dd9bcd2008e230990a38393be20feeb94605

Contents?: true

Size: 894 Bytes

Versions: 14

Compression:

Stored size: 894 Bytes

Contents

/*!
 * Ladda for jQuery
 * http://lab.hakim.se/ladda
 * MIT licensed
 *
 * Copyright (C) 2015 Hakim El Hattab, http://hakim.se
 */

(function( Ladda, $ ) {
	if ($ === undefined)
		return console.error( 'jQuery required for Ladda.jQuery' );

	var arr = [];

	$ = $.extend( $, {
		ladda: function( arg ) {
			if( arg === 'stopAll' )
				Ladda.stopAll();
		}
	});

	$.fn = $.extend( $.fn, {
		ladda: function( arg ) {
			var args = arr.slice.call( arguments, 1 );

			if( arg === 'bind' ) {
				args.unshift( $( this ).selector );
				Ladda.bind.apply( Ladda, args );
			}
			else {
				$( this ).each( function() {
					var $this = $( this ), ladda;

					if( arg === undefined )
						$this.data( 'ladda', Ladda.create( this ) );
					else {
						ladda = $this.data( 'ladda' );
						ladda[arg].apply( ladda, args );
					}
				});
			}

			return this;
		}
	});	
}( this.Ladda, this.jQuery ));

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
try_api-0.0.18 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.17 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.16 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.15 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.14 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.13 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.12 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.11 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.10 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.9 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.8 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.7 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
try_api-0.0.6 app/assets/javascripts/try_api/bower_components/ladda/js/ladda.jquery.js
ladda-rails-0.9.7 vendor/assets/javascripts/ladda.jquery.js