If I have got:
blockRoutes = function (value) {
$('body').trigger('cantLeaveRoute', { val: value });
return value;
}
Except in binding callback like:
this.bind('cantLeaveRoute', function () {
this.params['val'] === true ? nav.disableHeader() : nav.enableHeader()
});
How can I DIRECTLY (without the bind shown above) read the current value of the param?
Something along the lines of the wrong syntax below:
$('body').data('events')['cantLeaveRoute'].val
The parameters you set in trigger are part of the event
this.bind('cantLeaveRoute', function (event) {
var value = event.data.val;
value === true ? nav.disableHeader() : nav.enableHeader()
});