tinymce.full.js
function fire(name, args) {
        var handlers, i, l, callback;

        name = name.toLowerCase();
        args = args || {};
        args.type = name;

        // Setup target is there isn't one
        if (!args.target) {
          args.target = scope;
        }

        // Add event delegation methods if they are missing
        if (!args.preventDefault) {
          // Add preventDefault method
          args.preventDefault = function () {
            args.isDefaultPrevented = returnTrue;
          };

          // Add stopPropagation
          args.stopPropagation = function () {
            args.isPropagationStopped = returnTrue;
          };

          // Add stopImmediatePropagation
          args.stopImmediatePropagation = function () {
            args.isImmediatePropagationStopped = returnTrue;
          };

          // Add event delegation states
          args.isDefaultPrevented = returnFalse;
          args.isPropagationStopped = returnFalse;
          args.isImmediatePropagationStopped = returnFalse;
        }

        if (settings.beforeFire) {
          settings.beforeFire(args);
        }

        handlers = bindings[name];
        if (handlers) {
          for (i = 0, l = handlers.length; i < l; i++) {
            callback = handlers[i];

            // Unbind handlers marked with "once"
            if (callback.once) {
              off(name, callback.func);
            }

            // Stop immediate propagation if needed
            if (args.isImmediatePropagationStopped()) {
              args.stopPropagation();
              return args;
            }

            // If callback returns false then prevent default and stop all propagation
            if (callback.func.call(scope, args) === false) {
              args.preventDefault();
              return args;
            }
          }
        }

        return args;
      }
function fire(name, args) {
        var handlers, i, l, callback;

        name = name.toLowerCase();
        args = args || {};
        args.type = name;

        // Setup target is there isn't one
        if (!args.target) {
          args.target = scope;
        }

        // Add event delegation methods if they are missing
        if (!args.preventDefault) {
          // Add preventDefault method
          args.preventDefault = function () {
            args.isDefaultPrevented = returnTrue;
          };

          // Add stopPropagation
          args.stopPropagation = function () {
            args.isPropagationStopped = returnTrue;
          };

          // Add stopImmediatePropagation
          args.stopImmediatePropagation = function () {
            args.isImmediatePropagationStopped = returnTrue;
          };

          // Add event delegation states
          args.isDefaultPrevented = returnFalse;
          args.isPropagationStopped = returnFalse;
          args.isImmediatePropagationStopped = returnFalse;
        }

        if (settings.beforeFire) {
          settings.beforeFire(args);
        }

        handlers = bindings[name];
        if (handlers) {
          for (i = 0, l = handlers.length; i < l; i++) {
            callback = handlers[i];

            // Unbind handlers marked with "once"
            if (callback.once) {
              off(name, callback.func);
            }

            // Stop immediate propagation if needed
            if (args.isImmediatePropagationStopped()) {
              args.stopPropagation();
              return args;
            }

            // If callback returns false then prevent default and stop all propagation
            if (callback.func.call(scope, args) === false) {
              args.preventDefault();
              return args;
            }
          }
        }

        return args;
      }
function fire ( name , args ) { var handlers , i , l , callback ; name = name . toLowerCase ( ) ; args = args || { } ; args . type = name ; // Setup target is there isn't one if ( ! args . target ) { args . target = scope ; } // Add event delegation methods if they are missing if ( ! args . preventDefault ) { // Add preventDefault method args . preventDefault = function ( ) { args . isDefaultPrevented = returnTrue ; } ; // Add stopPropagation args . stopPropagation = function ( ) { args . isPropagationStopped = returnTrue ; } ; // Add stopImmediatePropagation args . stopImmediatePropagation = function ( ) { args . isImmediatePropagationStopped = returnTrue ; } ; // Add event delegation states args . isDefaultPrevented = returnFalse ; args . isPropagationStopped = returnFalse ; args . isImmediatePropagationStopped = returnFalse ; } if ( settings . beforeFire ) { settings . beforeFire ( args ) ; } handlers = bindings [ name ] ; if ( handlers ) { for ( i = 0 , l = handlers . length ; i < l ; i ++ ) { callback = handlers [ i ] ; // Unbind handlers marked with "once" if ( callback . once ) { off ( name , callback . func ) ; } // Stop immediate propagation if needed if ( args . isImmediatePropagationStopped ( ) ) { args . stopPropagation ( ) ; return args ; } // If callback returns false then prevent default and stop all propagation if ( callback . func . call ( scope , args ) === false ) { args . preventDefault ( ) ; return args ; } } } return args ; }
Fires the specified event by name.

@method fire
@param {String} name Name of the event to fire.
@param {Object?} args Event arguments.
@return {Object} Event args instance passed in.
@example
instance.fire('event', {...});
Fires the specified event by name .