Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Calling .fbMessenger on the same element again does not apply new option settings #10

Open
wycoconut opened this issue Oct 13, 2017 · 0 comments

Comments

@wycoconut
Copy link

wycoconut commented Oct 13, 2017

Had a problem where I need to reinitialize the element with different options.
Would be nice if a proper "destroy" method is available on the plugin. Thanks!

My temporary workaround

I used this to destroy the instance before recreating it.

            if ($('.phone2').data("jquery.fbmessenger") !== undefined) {
                $('.phone2').removeData("jquery.fbmessenger");
                $('.phone2').empty();
            }

            $('.phone2').fbMessenger({ botName: 'My New Bot Name' });
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant