From 5cae8766c260ee6dd765155e22cddfdf98f207ac Mon Sep 17 00:00:00 2001 From: jbarata Date: Thu, 7 Feb 2013 12:13:56 +0000 Subject: [PATCH] fixed keydown event namespace without a proper namespace, the keydown event was being unbinded of every elemnt in the page and those stopped working. For example, it was unbinding existing shortcuts in the page (using Shortcuts.Js lib) --- guiders-1.3.0.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guiders-1.3.0.js b/guiders-1.3.0.js index 55a4970..0dbf447 100644 --- a/guiders-1.3.0.js +++ b/guiders-1.3.0.js @@ -168,7 +168,7 @@ var guiders = (function($) { }; guiders._wireEscape = function (myGuider) { - $(document).keydown(function(event) { + $(document).on('keydown.guiders', function(event) { if (event.keyCode == 27 || event.which == 27) { guiders.hideAll(); if (myGuider.onClose) { @@ -176,11 +176,11 @@ var guiders = (function($) { } return false; } - }); + }); }; guiders._unWireEscape = function (myGuider) { - $(document).unbind("keydown"); + $(document).unbind("keydown.guiders"); }; guiders._attach = function(myGuider) {