You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is caused by the fact that turbolinks is replacing the body contents, but not reloading the widearea plugin. Consequently the call to setInterval persists across page views, causing the error you describe when the user navigates away from a page containing one or more elements with a data-widearea="enable" attribute, to a page containing none.
Disabling turbolinks solves the problem, although this is not a great solution.
Another workaround is as follows. Change this line:
this._timer=window.setInterval(function(){
to:
_wideAreaTimer=window.setInterval(function(){
This makes the reference to the timer global. It can then be cancelled in the plugins constructor function, before re-initializing it (or not).
When using this with Rails with turbolinks (standard in Rails 4) you get an endless loop of:
Uncaught TypeError: Cannot read property 'offsetWidth' of null
The text was updated successfully, but these errors were encountered: