Sha256: 7ac60fd8b4d1bc39d6d8867f48db859ed9c256188dfc566329c6be37b5e7273b

Contents?: true

Size: 1.11 KB

Versions: 24

Compression:

Stored size: 1.11 KB

Contents

//>>excludeStart("exclude", pragmas.exclude);
define([ "shoestring" ], function(){
//>>excludeEnd("exclude");

	/**
	 * Trigger an event on each of the DOM elements in the current set.
	 *
	 * @param {string} event The event(s) to trigger.
	 * @param {object} args Arguments to append to callback invocations.
	 * @return shoestring
	 * @this shoestring
	 */
	shoestring.fn.trigger = function( event, args ){
		var evts = event.split( " " );

		return this.each(function(){
			var split, evt, namespace;
			for( var i = 0, il = evts.length; i < il; i++ ){
				split = evts[ i ].split( "." ),
				evt = split[ 0 ],
				namespace = split.length > 0 ? split[ 1 ] : null;

				if( evt === "click" ){
					if( this.tagName === "INPUT" && this.type === "checkbox" && this.click ){
						this.click();
						return false;
					}
				}

				if( doc.createEvent ){
					var event = doc.createEvent( "Event" );
					event.initEvent( evt, true, true );
					event._args = args;
					event._namespace = namespace;

					this.dispatchEvent( event );
				}
			}
		});
	};

//>>excludeStart("exclude", pragmas.exclude);
});
//>>excludeEnd("exclude");

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/shoestring/src/events/trigger.js
trusty-cms-5.0.7 node_modules/shoestring/src/events/trigger.js
trusty-cms-5.0.6 node_modules/shoestring/src/events/trigger.js
trusty-cms-5.0.5 node_modules/shoestring/src/events/trigger.js
trusty-cms-5.0.4 node_modules/shoestring/src/events/trigger.js
trusty-cms-5.0.3 node_modules/shoestring/src/events/trigger.js
trusty-cms-5.0.2 node_modules/shoestring/src/events/trigger.js
trusty-cms-5.0.1 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.3.5 node_modules/shoestring/src/events/trigger.js
trusty-cms-5.0.0 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.3.4 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.3.3 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.3.2 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.3.1 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.3 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.2.3 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.2.2 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.2.1 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.2 node_modules/shoestring/src/events/trigger.js
trusty-cms-4.1.9 node_modules/shoestring/src/events/trigger.js