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

Passing buttons #32

Closed
mikeazo opened this issue Mar 13, 2015 · 1 comment
Closed

Passing buttons #32

mikeazo opened this issue Mar 13, 2015 · 1 comment
Labels

Comments

@mikeazo
Copy link

mikeazo commented Mar 13, 2015

I realize after digging through the code that how I was doing things is not really the correct way to do it, but there may still be a bug here.

Here is the fiddle: http://jsfiddle.net/33z0da4f/

It opens two dialogs (pull the second one out of the way to see the first). When you click "okay" you should get a notification. It doesn't work on the first dialog.

The work around is to not pass buttons in, but specify it directly in the factory. That is fine and probably the better way to do things, but I am surprised that the code doesn't work.

@MohammadYounes
Copy link
Owner

When you specify buttons definition directly, each initialized instance will gets own copy.

But when passing buttons variable by reference and since your dialog is transient, the second call initializes a new instance and when the DOM element for the button is created, its saved along with the button definition! Thus overriding the previous value.

Hope this clarifies why that code didn't work.

Thanks.

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

No branches or pull requests

2 participants