[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:
Géry Debongnie
2015-04-03 11:13:53 +02:00
parent 343ee7ed1e
commit d12bf0eb4a
+1 -1
View File
@@ -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);
});