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

Theme on post method #102

Open
fvfv opened this issue Dec 17, 2015 · 3 comments
Open

Theme on post method #102

fvfv opened this issue Dec 17, 2015 · 3 comments

Comments

@fvfv
Copy link

fvfv commented Dec 17, 2015

I would like to reuse the Messenger object and include in the options a different theme depending on the message from the server.

In other words. I'm not able to pass theme option on the post method. I can only change the theme on
Messenger.options = {theme:'air'}; But since its a global change, I am not able to reuse an already initialized Messenger object from the same page. I believe the way that I'm doing it will cause a memory leak:

Messenger.options = {theme:'air'};
Messenger().post ("test");

If this code is run many times while the page is not refreshed. Am I wrong in assuming that Messenger() creates a new instance every time is run?

@urosgruber
Copy link

Theme is Messenger property. So try

Messenger({theme:'air'}).post ("test");

@leompeters
Copy link

@urosgruber I tried what you said but still getting the same error. Do you have other options:

I am having a similar issue but for this.options.themes in the file https://github.com/HubSpot/messenger/blob/master/docs/welcome/javascripts/theme-sel.js#L25:

Uncaught TypeError: Cannot read property 'themes' of undefined

@leompeters
Copy link

Got it!!! My similar issue was gone with UnderscoreJS VERSION 1.4.3 and BackboneJS VERSION 0.9.10.

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

3 participants