-
Notifications
You must be signed in to change notification settings - Fork 421
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
can.route triggers event two times for setting nested object. #269
Comments
Does your pull request #272 solve this? |
No, it is different problem. |
Maybe similar to this one #280 |
Part of the issue is: can.route.attr({notifications: {messages: true}}) You are passing a non-string value, but this gets added to the hash, which converts it to a string, hence the double change. We could try to force every incoming value to a string in can.route. Can you create a test? |
I think you can fix this with the define plugin:
|
I would double check if this hasn't been fixed with #1187 yet which I merged yesterday. |
Nervemind, that looks like it's something different. |
Looks to be fixed.
|
I want to use two level object in route for control some panel with widgets.
When i want to make widget visible i can easily trigger
can.route.attr({notifications: {messages: true}})
and when i want to hide it i will call
can.route.removeAttr('notifications.messages')
and each widget listen on route change for given 'code'
can.route.bind('notifications.messages', function() {....})
Idea worked fine until i find some strange behaviour that event is triggered 2 times.
First for whole object {notifications ...}
Second for notifications.messages (And there it pass new value as stringified
"true"
and old value as standardtrue
Thing with stringified true is even more stranger :)
More in console in this Fiddle
The text was updated successfully, but these errors were encountered: