code: function inner_onclick(e) {
              var value = this.value;
              var close_parent = true;
  
              if (that.current_submenu) {
                  that.current_submenu.close(e);
              }
  
              //global callback
              if (options.callback) {
                  var r = options.callback.call(
                      this,
                      value,
                      options,
                      e,
                      that,
                      options.node
                  );
                  if (r === true) {
                      close_parent = false;
                  }
              }
  
              //special cases
              if (value) {
                  if (
                      value.callback &&
                      !options.ignore_item_callbacks &&
                      value.disabled !== true
                  ) {
                      //item callback
                      var r = value.callback.call(
                          this,
                          value,
                          options,
                          e,
                          that,
                          options.extra
                      );
                      if (r === true) {
                          close_parent = false;
                      }
                  }
                  if (value.submenu) {
                      if (!value.submenu.options) {
                          throw "ContextMenu submenu needs options";
                      }
                      var submenu = new that.constructor(value.submenu.options, {
                          callback: value.submenu.callback,
                          event: e,
                          parentMenu: that,
                          ignore_item_callbacks:
                              value.submenu.ignore_item_callbacks,
                          title: value.submenu.title,
                          extra: value.submenu.extra,
                          autoopen: options.autoopen
                      });
                      close_parent = false;
                  }
              }
  
              if (close_parent && !that.lock) {
                  that.close();
              }
          }
docs: menu option clicked