From 31caa37112fa7000510952cedd177b1684005cf9 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 14 Aug 2012 17:36:56 +0300 Subject: [PATCH] Update lib/client/keyBinding.js --- lib/client/keyBinding.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index 4d123ff1..e0a59586 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -23,10 +23,16 @@ CloudCommander.KEY = { F10 : 121 }; -CloudCommander.mouseBinding = (function(){ - document.oncontextmenu = function(){ +CloudCommander.mouseBinding = (function(pElement){ + var isElement = pElement ? true : false; + if(pElement){ + pElement = document; + } + pElement.oncontextmenu = function(){ if(typeof CloudCommander.Menu === 'function') CloudCommander.Menu(); + else if(isElement) + CloudCommander.Menu.show(); } })