I have a knockout click binding function that works in Chrome and IE, but errors in firefox with the following error:
ReferenceError: event is not defined
I realise that I have to pass in the event as it's not part of the window in FF, but it looks like FF changes the binding so that I am unable to pass in the event.
My template as written looks like this:
<button class="btn subplan" data-bind="click: function(data, event) { $root.openPlanModal(data, event) }, css: {'btn-success': (percentComplete()==100 && statusOverride()=='' && SOCexpired()==false) || (statusOverride()=='pass' && SOCexpired()==false), 'btn-warning':percentComplete()<100 && percentComplete()>0 && statusOverride()=='' && SOCexpired()==false, 'btn-danger': statusOverride()=='fail' || SOCexpired()==true}">
<span data-bind="text: name()">Navigationserklärung</span>
<span style="display: block" data-bind="text: latestSOCDateDisplay()"></span>
</button>
However, when rendered by FF is looks like this (without the params):
<button class="btn subplan btn-success" data-bind="click: function(){ ($root.openPlanModal || $root.trainingModel().openPlanModal)($data, event) }, css: {'btn-success': (percentComplete()==100 && statusOverride()=='' && SOCexpired()==false) || (statusOverride()=='pass' && SOCexpired()==false), 'btn-warning':percentComplete()<100 && percentComplete()>0 && statusOverride()=='' && SOCexpired()==false, 'btn-danger': statusOverride()=='fail' || SOCexpired()==true}">
<span data-bind="text: name()">Navigationserklärung</span>
<span style="display: block" data-bind="text: latestSOCDateDisplay()"></span>
</button>
The CSS binding still seems to work and colour the button accordingly, but the params to the click binding function have gone.