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:
commit
5abf7e9535
@ -472,13 +472,21 @@
|
|||||||
|
|
||||||
// Bind along with custom handler
|
// Bind along with custom handler
|
||||||
function _proxyListener(element, eventName, userListener, defaultListener, useCapture) {
|
function _proxyListener(element, eventName, userListener, defaultListener, useCapture) {
|
||||||
|
if(userListener) {
|
||||||
|
// Register this before defaultListener
|
||||||
|
_on(
|
||||||
|
element,
|
||||||
|
eventName,
|
||||||
|
function(event) {
|
||||||
|
userListener.apply(element, [event]);
|
||||||
|
},
|
||||||
|
useCapture
|
||||||
|
);
|
||||||
|
}
|
||||||
_on(
|
_on(
|
||||||
element,
|
element,
|
||||||
eventName,
|
eventName,
|
||||||
function(event) {
|
function(event) {
|
||||||
if (userListener) {
|
|
||||||
userListener.apply(element, [event]);
|
|
||||||
}
|
|
||||||
defaultListener.apply(element, [event]);
|
defaultListener.apply(element, [event]);
|
||||||
},
|
},
|
||||||
useCapture
|
useCapture
|
||||||
|
Loading…
x
Reference in New Issue
Block a user