Sha256: ee778b46d8677f0a46f21b02f6280548c1afb7d1fd8aa72980e0925362681ccc

Contents?: true

Size: 769 Bytes

Versions: 24

Compression:

Stored size: 769 Bytes

Contents

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

	/**
	 * Insert an element or HTML string before each element in the current set.
	 *
	 * @param {string|HTMLElement} fragment The HTML or HTMLElement to insert.
	 * @return shoestring
	 * @this shoestring
	 */
	shoestring.fn.before = function( fragment ){
		if( typeof( fragment ) === "string" || fragment.nodeType !== undefined ){
			fragment = shoestring( fragment );
		}

		return this.each(function( i ){
			for( var j = 0, jl = fragment.length; j < jl; j++ ){
				this.parentNode.insertBefore( i > 0 ? fragment[ j ].cloneNode( true ) : fragment[ j ], this );
			}
		});
	};

//>>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/dom/before.js
trusty-cms-5.0.7 node_modules/shoestring/src/dom/before.js
trusty-cms-5.0.6 node_modules/shoestring/src/dom/before.js
trusty-cms-5.0.5 node_modules/shoestring/src/dom/before.js
trusty-cms-5.0.4 node_modules/shoestring/src/dom/before.js
trusty-cms-5.0.3 node_modules/shoestring/src/dom/before.js
trusty-cms-5.0.2 node_modules/shoestring/src/dom/before.js
trusty-cms-5.0.1 node_modules/shoestring/src/dom/before.js
trusty-cms-4.3.5 node_modules/shoestring/src/dom/before.js
trusty-cms-5.0.0 node_modules/shoestring/src/dom/before.js
trusty-cms-4.3.4 node_modules/shoestring/src/dom/before.js
trusty-cms-4.3.3 node_modules/shoestring/src/dom/before.js
trusty-cms-4.3.2 node_modules/shoestring/src/dom/before.js
trusty-cms-4.3.1 node_modules/shoestring/src/dom/before.js
trusty-cms-4.3 node_modules/shoestring/src/dom/before.js
trusty-cms-4.2.3 node_modules/shoestring/src/dom/before.js
trusty-cms-4.2.2 node_modules/shoestring/src/dom/before.js
trusty-cms-4.2.1 node_modules/shoestring/src/dom/before.js
trusty-cms-4.2 node_modules/shoestring/src/dom/before.js
trusty-cms-4.1.9 node_modules/shoestring/src/dom/before.js