arvgta / ajaxify

Ajaxify - The Ajax Plugin
https://4nf.org/
274 stars 124 forks source link

New Pronto event interface #209

Closed arvgta closed 3 years ago

arvgta commented 3 years ago

The old jQuery event interface for listening to Pronto events has been modified:

...from...

$(window).on('pronto.request', function(event, eventInfo){ //event holds the name of the event again
    var target = eventInfo.target || eventInfo.srcElement;
    console.debug(target) //target holds originary event info
})

...to...

window.addEventListener('pronto.request', function(event){
    var target = event.data.target || event.data.srcElement; //intermediate data attribute
    console.debug(target) //target holds originary event info
})

Are you happy with this change?

(It breaks backward compatibility, but is arguably a simplification, because only one parameter is passed to the handler...)