diff --git a/lib/client/viewer.js b/lib/client/viewer.js index eb962b6f..e53b004b 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -134,8 +134,8 @@ CloudCommander.Viewer.FancyBox = { CloudCommander.Viewer.Keys = (function(){ "use strict"; - var lCallBack_f = (function(){ - var key_event = function(pParent){ + var lCallBack_f = (function(pParent){ + var key_event = function(){ return function(event){ /* если клавиши можно обрабатывать */ if(CloudCommander.keyBinded){ @@ -162,11 +162,11 @@ CloudCommander.Viewer.Keys = (function(){ /* добавляем обработчик клавишь */ if (document.addEventListener) - document.addEventListener('keydown', key_event(this),false); + document.addEventListener('keydown', key_event(pParent),false); else document.onkeypress=key_event; }); - CloudCommander.Viewer.FancyBox.load(this.FancyBox, lCallBack_f); + CloudCommander.Viewer.FancyBox.load(this.FancyBox, lCallBack_f(this)); }); \ No newline at end of file