[FIX] web: don't crash when switching views in firefox
For some weird reasons, IE and Chrome (or jquery?) bind the global variable 'event' to the last triggered event (I guess). Of course, our code depended on that behavior, but Firefox does not like it and crashes when we try to read the 'event' variable. This fix simply gets the variable as first argument.
This commit is contained in:
@@ -234,7 +234,7 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
|
||||
});
|
||||
|
||||
// Add onclick event listener
|
||||
this.control_elements.$switch_buttons.siblings('button').click(function() {
|
||||
this.control_elements.$switch_buttons.siblings('button').click(function(event) {
|
||||
var view_type = $(event.target).data('view-type');
|
||||
self.switch_mode(view_type);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user