Merge pull request #703 from gurupras/early-listener-fix

Allow Plyr.setup event listeners to be set up as separate event listeners
This commit is contained in:
Sam Potts 2017-11-04 18:15:03 +11:00 committed by GitHub
commit 5abf7e9535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -472,13 +472,21 @@
// Bind along with custom handler
function _proxyListener(element, eventName, userListener, defaultListener, useCapture) {
if(userListener) {
// Register this before defaultListener
_on(
element,
eventName,
function(event) {
userListener.apply(element, [event]);
},
useCapture
);
}
_on(
element,
eventName,
function(event) {
if (userListener) {
userListener.apply(element, [event]);
}
defaultListener.apply(element, [event]);
},
useCapture