code: function(value, flag) {
  			var className,
  				hasClass,
  				rnotwhite = /\S+/g,
  				classNames = value.match(rnotwhite) || [],
  				i = 0,
  				wasAdded = false,
  				statusElem = this[this.tree.statusClassPropName],
  				curClasses = " " + (this.extraClasses || "") + " ";
  
  			// this.info("toggleClass('" + value + "', " + flag + ")", curClasses);
  			// Modify DOM element directly if it already exists
  			if (statusElem) {
  				$(statusElem).toggleClass(value, flag);
  			}
  			// Modify node.extraClasses to make this change persistent
  			// Toggle if flag was not passed
  			while ((className = classNames[i++])) {
  				hasClass = curClasses.indexOf(" " + className + " ") >= 0;
  				flag = flag === undefined ? !hasClass : !!flag;
  				if (flag) {
  					if (!hasClass) {
  						curClasses += className + " ";
  						wasAdded = true;
  					}
  				} else {
  					while (curClasses.indexOf(" " + className + " ") > -1) {
  						curClasses = curClasses.replace(
  							" " + className + " ",
  							" "
  						);
  					}
  				}
  			}
  			this.extraClasses = $.trim(curClasses);
  			// this.info("-> toggleClass('" + value + "', " + flag + "): '" + this.extraClasses + "'");
  			return wasAdded;
  		}
docs: Set, clear, or toggle class of node's span tag and .extraClasses.
  
  @param {string} className class name (separate multiple classes by space)
  @param {boolean} [flag] true/false to add/remove class. If omitted, class is toggled.
  @returns {boolean} true if a class was added
  
  @since 2.17