Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Pronto event interface #209

Closed
arvgta opened this issue Dec 27, 2020 · 0 comments
Closed

New Pronto event interface #209

arvgta opened this issue Dec 27, 2020 · 0 comments

Comments

@arvgta
Copy link
Owner

arvgta commented Dec 27, 2020

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...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant