I need your help.
I have 2 functions:
addMoveListeners: function(e) {
e = e || window.event;
// Binging context to function move
moveListener = MYAPP.move.bind(e.target.parentElement);
//
if (e.target.classList.contains('move')){
document.addEventListener('mousemove', moveListener, false);
document.addEventListener('mouseup', MYAPP.removeListener, false);
}
resizeListener = MYAPP.resize.bind(e.target.parentElement);
if (e.target.classList.contains('resize')){
document.addEventListener('mousemove', resizeListener, false);
document.addEventListener('mouseup', MYAPP.removeListener, false);
}
return false;
},
and this:
removeListener: function(e){
e = e || window.event;
//Here I want get element from function
console.dir(resizeListener);
// Function stores it in [[BoundThis]]
document.removeEventListener('mousemove', resizeListener, false);
document.removeEventListener('mouseup', MYAPP.removeListener, false);
document.removeEventListener('mousemove', moveListener, false);
document.removeEventListener('mouseup', MYAPP.moveListener, false);
},
How can I get property [[BoundThis]] from function resizeListener without execution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…