Skip to content

MenuOnClose Event? #4

@HannibalZA

Description

@HannibalZA

Would be nice to have an eventHandler to catch when the menu closes.

This helps with some cleanups and more global post-action procedures.

Currently the only option would be to put repetitive code under each action.

Something like so...

        onClose: function($elem) {

            alertify.notify("Done with : " + $elem.text());

        },

By adding:

   /* user-defined function to execute parting methods against opened element...*/

    onClose: _.noop,

And further down
// close the context menu

BootstrapMenu.prototype.close = function() {

    // hide the menu

    if (this.$openTarget) { this.options.onClose(this.$openTarget) };

    this.$menu.hide();

    clearCloseEventListeners(this);

};

This is rough, but I've added it for my own purposes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions