Sha256: e23d4421472666757d40538a0d337bf45db49628e5eae31ed4de003a3e33cddb

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

/*
 # -----------------------------------------------------------------------------
 # ~/assets/theme/j1/modules/jquery/js/extensions/removeClass.js
 # jQuery Plugin for J1 Theme
 # Used to to remove one or more class names from a selected element.
 #
 # Product/Info:
 # https://jekyll.one
 # https://github.com/Dogfalo/materialize
 #
 # Copyright (C) 2023, 2024 Juergen Adams
 #
 # J1 Template is licensed under the MIT License.
 # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
 # -----------------------------------------------------------------------------
*/
'use strict';

;(function(removeClass) {

	jQuery.fn.removeClass = function( value ) {
		if ( value && typeof value.test === "function" ) {
			for ( var i = 0, l = this.length; i < l; i++ ) {
				var elem = this[i];
				if ( elem.nodeType === 1 && elem.className ) {
					var classNames = elem.className.split( /\s+/ );

					for ( var n = classNames.length; n--; ) {
						if ( value.test(classNames[n]) ) {
							classNames.splice(n, 1);
						}
					}
					elem.className = jQuery.trim( classNames.join(" ") );
				}
			}
		} else {
			removeClass.call(this, value);
		}
		return this;
	}

})(jQuery.fn.removeClass);

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
j1-template-2024.3.16 assets/theme/j1/modules/jquery/js/extensions/removeClass.js
j1-template-2024.3.15 assets/theme/j1/modules/jquery/js/extensions/removeClass.js
j1-template-2024.3.14 assets/theme/j1/modules/jquery/js/extensions/removeClass.js
j1-template-2024.3.13 assets/theme/j1/modules/jquery/js/extensions/removeClass.js
j1-template-2024.3.12 assets/theme/j1/modules/jquery/js/extensions/removeClass.js