<commit_before>define([
	"Ember",
	"text!templates/components/formbutton.html.hbs"
], function( Ember, template ) {

	var get = Ember.get;
	var set = Ember.set;
	var and = Ember.computed.and;

	return Ember.Component.extend({
		layout: Ember.HTMLBars.compile( template ),
		tagName: "button",
		attributeBindings: [ "type", "title", "disabled" ],
		type: "button",
		title: null,
		classNameBindings: [
			":btn",
			"_iconAndNoText:btn-icon",
			"_iconAndText:btn-with-icon",
			"_iconanim:btn-with-anim",
			"class"
		],
		"class": null,

		action     : null,
		actionParam: null,

		icon: false,
		_iconAndText: and( "icon", "hasBlock" ),
		_iconAndNoText: function() {
			return get( this, "icon" ) && !get( this, "hasBlock" );
		}.property( "icon", "hasBlock" ),

		iconanim : false,
		_iconanim: false,

		click: function() {
			var action  = get( this, "action" );
			if ( !action ) { return; }

			var self    = this;
			var context = Ember.makeArray( get( this, "actionParam" ) );

			if ( get( this, "iconanim" ) ) {
				context = context.concat(function animationStart( data ) {
					var defer = Promise.defer();
					set( self, "_iconanim", true );
					self.$().one( "webkitAnimationEnd", function animationEnd( e ) {
						e = e.originalEvent;
						if ( e.animationName !== "animIconScale" ) { return; }

						set( self, "_iconanim", false );
						defer.resolve( data );
					});
					return defer.promise;
				});
			}

			this.triggerAction({
				target: get( this, "targetObject" ),
				action: action,
				actionContext: context
			});
		}
	});

});<commit_msg>Let the FormButtonComponent send actions to itself<commit_after>define([
	"Ember",
	"text!templates/components/formbutton.html.hbs"
], function( Ember, template ) {

	var get = Ember.get;
	var set = Ember.set;
	var and = Ember.computed.and;

	return Ember.Component.extend({
		layout: Ember.HTMLBars.compile( template ),
		tagName: "button",
		attributeBindings: [ "type", "title", "disabled" ],
		type: "button",
		title: null,
		classNameBindings: [
			":btn",
			"_iconAndNoText:btn-icon",
			"_iconAndText:btn-with-icon",
			"_iconanim:btn-with-anim",
			"class"
		],
		"class": null,

		action     : null,
		actionParam: null,

		icon: false,
		_iconAndText: and( "icon", "hasBlock" ),
		_iconAndNoText: function() {
			return get( this, "icon" ) && !get( this, "hasBlock" );
		}.property( "icon", "hasBlock" ),

		iconanim : false,
		_iconanim: false,

		click: function() {
			var action  = get( this, "action" );
			if ( !action ) { return; }

			var self    = this;
			var context = Ember.makeArray( get( this, "actionParam" ) );

			if ( get( this, "iconanim" ) ) {
				context = context.concat(function animationStart( data ) {
					var defer = Promise.defer();
					set( self, "_iconanim", true );
					self.$().one( "webkitAnimationEnd", function animationEnd( e ) {
						e = e.originalEvent;
						if ( e.animationName !== "animIconScale" ) { return; }

						set( self, "_iconanim", false );
						defer.resolve( data );
					});
					return defer.promise;
				});
			}

			// allow the component to send actions to itself
			// in case it has been extended and uses its own actions
			if ( this._actions instanceof Object && this._actions.hasOwnProperty( action ) ) {
				this.send.apply( this, [ action ].concat( context ) );

			} else {
				this.triggerAction({
					target: get( this, "targetObject" ),
					action: action,
					actionContext: context
				});
			}
		}
	});

});
{'fraction_non_alphanumeric': 0.16029876472278082, 'fraction_numerical': 0.0, 'mean_word_length': 3.0868544600938965, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3618707', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1166, 'n_words': 289}