-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fixed multiple call on language change. #112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will prevent the rendering of multiple progress bars, but I'm not sure it will take into account the new settings when the language is changed.
stupid idea! never going to work... |
OK, I think changing the initialize function adapt-contrib-pageLevelProgress.js to this: Adapt.on({
'app:dataReady': this.onDataReady.bind(this),
'app:languageChanged': function() {
this.stopListening();
}.bind(this)
}); works OK...? If, like me, you look at that code and are tempted to tidy it up, be aware that if you do either this: Adapt.on({
'app:dataReady': this.onDataReady,
'app:languageChanged': this.stopListening
}, this); Then both those event handlers get removed by This works: Adapt.on({
'app:dataReady': this.onDataReady.bind(this),
'app:languageChanged': this.stopListening.bind(this)
}); |
@moloko I am also wondering.
both these two line doing same thing.May be the mess with scope.
|
Well, you'd think so wouldn't you? but when I tried |
Worked fine for me. |
Refer:Issue