Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an off() functionionality? #35

Open
ManuZenou opened this issue Aug 24, 2017 · 4 comments
Open

Is there an off() functionionality? #35

ManuZenou opened this issue Aug 24, 2017 · 4 comments

Comments

@ManuZenou
Copy link

Im user 'on' to bind select event.

wdtEmojiBundle.on('select', function (event) {
	XXXXXXXX
});

can do I unbind it?
is there an off() function?

Thanks.

@ManuZenou ManuZenou changed the title Is there a OFF function? Is there an off() functionionality? Aug 24, 2017
@ManuZenou
Copy link
Author

is there a way to 'destroy' the emoji picker?

@needim
Copy link
Owner

needim commented Aug 24, 2017

Hımm good point. Currently, we don't have that functionality.

@Vuurvlieg
Copy link

I need this functionality so when it would be added?

@ktrzeciaknubisa
Copy link

You can write your own simple function and place it anywhere in the code. e.g.:

    wdtEmojiBundle.off = function (eventName, handler) {
        switch (eventName) {
            case "select":
                return wdtEmojiBundle.dispatchHandlers.select = [];
                break;
            case "afterSelect":
                return wdtEmojiBundle.dispatchHandlers.afterSelect = [];
                break;
            case "afterPickerOpen":
                return wdtEmojiBundle.dispatchHandlers.afterPickerOpen = [];
                break;
            default:
                console.error('wdt-emoji-bundle - Not supported event type!', eventName);
                break;
        }
    };

and just call it like:

 wdtEmojiBundle.off('afterSelect')

The function is a modified version of wdtEmojiBundle.on()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants