From 7bb4950a1c497287f99c7658ea755fd03f932aa3 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Wed, 15 Dec 2010 14:14:15 +0100 Subject: [PATCH] fix lib functions --- plugins/pilot/event.js | 8 ++++---- plugins/pilot/fixoldbrowsers.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/pilot/event.js b/plugins/pilot/event.js index 0e2d003e..6b360007 100644 --- a/plugins/pilot/event.js +++ b/plugins/pilot/event.js @@ -148,14 +148,14 @@ else { eventHandler && eventHandler(e); releaseCaptureHandler && releaseCaptureHandler(); - exports.removeEventListener("mousemove", onMouseMove, true); - exports.removeEventListener("mouseup", onMouseUp, true); + el.removeEventListener("mousemove", onMouseMove, true); + el.removeEventListener("mouseup", onMouseUp, true); e.stopPropagation(); } - exports.addEventListener("mousemove", onMouseMove, true); - exports.addEventListener("mouseup", onMouseUp, true); + el.addEventListener("mousemove", onMouseMove, true); + el.addEventListener("mouseup", onMouseUp, true); }; } diff --git a/plugins/pilot/fixoldbrowsers.js b/plugins/pilot/fixoldbrowsers.js index b3026a71..5387187f 100644 --- a/plugins/pilot/fixoldbrowsers.js +++ b/plugins/pilot/fixoldbrowsers.js @@ -105,7 +105,7 @@ if (!Object.keys) { if (!Function.prototype.bind) { // from MDC // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind - Function.prototype.bind = function () { + Function.prototype.bind = function (obj) { var slice = [].slice; var args = slice.call(arguments, 1); var self = this; @@ -114,7 +114,7 @@ if (!Function.prototype.bind) { // optimize common case if (arguments.length == 1) { var bound = function() { - return fcn.apply(this instanceof nop ? this : obj, arguments); + return self.apply(this instanceof nop ? this : obj, arguments); }; } else {