tinymce.full.js
function (cls, state) {
        var curState = this.contains(cls);

        if (curState !== state) {
          if (curState) {
            this.remove(cls);
          } else {
            this.add(cls);
          }

          this._change();
        }

        return this;
      }
function (cls, state) {
        var curState = this.contains(cls);

        if (curState !== state) {
          if (curState) {
            this.remove(cls);
          } else {
            this.add(cls);
          }

          this._change();
        }

        return this;
      }
function ( cls , state ) { var curState = this . contains ( cls ) ; if ( curState !== state ) { if ( curState ) { this . remove ( cls ) ; } else { this . add ( cls ) ; } this . _change ( ) ; } return this ; }
Toggles a class in the class list.

@method toggle
@param {String} cls Class to be added/removed.
@param {Boolean} state Optional state if it should be added/removed.
@return {tinymce.ui.ClassList} Current class list instance.
Toggles a class in the class list .