jamon.js
function addRemoveToggleClass (context, className, method) {
		// Split by spaces, then remove empty elements caused by extra whitespace
		const classNames = trimAndSplit(className);

		if (classNames.length) {
			context.forEach(element => {
				if (method !== "toggle") {
					// 'add' and 'remove' accept multiple parameters…
					element.classList[method](...classNames);
				} else {
					// while 'toggle' accepts only one
					classNames.forEach(className => element.classList.toggle(className))
					}
			});
				}

		return context;
	}
function addRemoveToggleClass (context, className, method) {
		// Split by spaces, then remove empty elements caused by extra whitespace
		const classNames = trimAndSplit(className);

		if (classNames.length) {
			context.forEach(element => {
				if (method !== "toggle") {
					// 'add' and 'remove' accept multiple parameters…
					element.classList[method](...classNames);
				} else {
					// while 'toggle' accepts only one
					classNames.forEach(className => element.classList.toggle(className))
					}
			});
				}

		return context;
	}
function addRemoveToggleClass ( context , className , method ) { // Split by spaces, then remove empty elements caused by extra whitespace const classNames = trimAndSplit ( className ) ; if ( classNames . length ) { context . forEach ( element => { if ( method !== "toggle" ) { // 'add' and 'remove' accept multiple parameters… element . classList [ method ] ( ... classNames ) ; } else { // while 'toggle' accepts only one classNames . forEach ( className => element . classList . toggle ( className ) ) } } ) ; } return context ; }
Add, remove, or toggle class names
@private
@param {Jamon} context - The Jamón instance
@param {string} className - Space-separated class names
@param {string} method - Method to use on the class name(s)
@return {Jamon}
Add remove or toggle class names