如果有该样式 就去除 否则就添加
@param element
@param classToToggle
493470
function(element,classToToggle){
        if (!hasClass(element, classToToggle)) {
            this.addClass(element,classToToggle);
        }else{
            this.removeClass(element,classToToggle);
        }
        return this;
    }
86523
function(element)
	{
		var i, l;

		this.element = element;

		this._rebindSubViews(element, {
			subviewIndex: 0,
			subviewsStructIndex: 0,
			index: 0
		});

		if(this._modelBindersMap)
		{
			this._modelBindersMap.setView(this);
		}

		if(this._collectionBinder)
		{
			this._collectionBinder.view = this;
		}

	}
1127648
function toggle(progress) {
  var opts = this.options;
  var element = this.element;
  var times = Object.keys(opts);

  times.forEach(function(time) {
    var css = opts[time];

    if (progress > time) {
      element.classList.add(css);
    } else {
      element.classList.remove(css);
    }
  });
}
666236
function(element, value) {
	if(element){
		if(typeof element.classList === 'undefined') {
			if(u._addClass){
				u._addClass(element, value);
			}else{
				$(element).addClass(value);
			}

		} else {
			element.classList.add(value);
		}
	}

	return this;
}
716629
function toggleClass (el, type, val) {
  el && el.classList[val ? type : 'toggle'](val || type);
}
808249
public void remove(T element, Class<?> accessibleClass) {
		while (accessibleClass != null && accessibleClass != this.baseClass) {
			this.removeSingle(element, accessibleClass);

			for (Class<?> interf : accessibleClass.getInterfaces()) {
				this.removeSingle(element, interf);
			}

			accessibleClass = accessibleClass.getSuperclass();
		}
	}
1339599
function toggleShepherdModalClass(currentElement) {
  const shepherdModal = document.querySelector(`${classNames.modalTarget}`);

  if (shepherdModal) {
    shepherdModal.classList.remove(classNames.modalTarget);
  }

  currentElement.classList.add(classNames.modalTarget);
}
266851
function( element, classname )
        {
            if( element.classList )
                element.classList.add( classname );
            else // IE9
                element.className += ' ' + classname;
        }
1073069
public static void toggleButton(Button button) {

        if (isButtonPressed(button)) {
            button.removeStyleName(OpenCmsTheme.BUTTON_PRESSED);
        } else {
            button.addStyleName(OpenCmsTheme.BUTTON_PRESSED);
        }
    }
315168
function (element, options) {
    this.element = element;
    this.options = options;

    $(this.element).addClass(ClassName.tree);

    $(Selector.treeview + Selector.active, this.element).addClass(ClassName.open);

    this._setUpListeners();
  }
435721
public void add(int index, Object element) {

//        reporter.updateCounter++;
        if (index > elementCount) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + ">" + elementCount);
        }

        if (index < 0) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " < 0");
        }

        if (elementCount >= elementData.length) {
            increaseCapacity();
        }

        for (int i = elementCount; i > index; i--) {
            elementData[i] = elementData[i - 1];
        }

        elementData[index] = element;

        elementCount++;
    }
1365278
public void addTo(String section, Object element)
    {
        Composite s = (Composite)sections.get(section);
        if (s==null)
            add(element);
        else
            s.add(element);
    }
414823
function addClass( element ) {
  const addClassNamesArray = _sliceArgs( arguments );
  if ( hasClassList ) {
    element.classList.add.apply( element.classList, addClassNamesArray );
  } else {
    var classes = element.className.split( ' ' );
    addClassNamesArray.forEach( function( name ) {
      if ( classes.indexOf( name ) === -1 ) {
        classes.push( name );
      }
    } );
    element.className = classes.join( ' ' );
  }

  return element;
}
607692
function() {
    var togglers = $('img.toggler').click(function() {
      var src = $(this).attr('src');
      var idnum = $(this).attr('id').substr(7);
      $('tr.cg-' + idnum).toggle();
      if (src.substr(-9) == 'minus.png')
        $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
      else
        $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
    }).css('display', '');
    if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
        togglers.click();
    }
  }
689890
function toggleDisplay(selector,singleRowHeight,bindType) {
  var display = $(selector);
  var toggler = display.find(gTogglerClass).first();
  display.css({'height':'auto'});//set height to auto    
  var fullHeight = display.height();//get full content height when auto
  display.css({'height':singleRowHeight});//now set height to one row
  if (display.height() >= fullHeight) {//only show toggler if full contents larger than 1 row
      toggler.css('visibility','hidden');
  } else {
      toggler.css('visibility','visible');
  }
  if (bindType=='click') {  //bind click to toggle show/hide
    toggler.toggle(
        function() {
            $(this).addClass('hover')
              .closest(selector).addClass('show-all');
        },
        function() {
            $(this).removeClass('hover')
              .closest(selector).removeClass('show-all');
        }        
    );
    if (toggler.closest(selector).hasClass('show-all')) { // if class set in html
          toggler.addClass('hover').css({'visibility':'visible'}).click();
    }
  } else {                 //bind toggler hover to show all
    toggler.mouseenter(
        function() {
            display.addClass('show-all');
            $(this).addClass('hover');
        }
    );
    display.mouseleave(function() { //hide when mouse leaves display area
          $(this).removeClass('show-all');
          display.css({'height':singleRowHeight});
          toggler.removeClass('hover');
          return false;
      });
  }
  display.find('a').attr('tabindex','-1');//remove display links from tab order, to target tags only, use find('li a') 
  display.css('visibility','visible');//show element (to prevent flash)
}
1030611
function addClass(element, name) {
    var oldList = classList(element),
        newList = oldList + name;

    if (hasClass(oldList, name)) return; 

    // Trim the opening space.
    element.className = newList.substring(1);
  }
388407
function toggleClass(className) {
  var classes = className.split(/\s+/)
    , name
    , i;
  for(i = 0;i < classes.length;i++) {
    name = classes[i];
    if(this.hasClass(name)) {
      this.removeClass(name)
    }else{
      this.addClass(name)
    }
  }
}