diff --git a/ChangeLog b/ChangeLog index 6dad0bbd..43d4305c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,6 +34,10 @@ to cloudcmd.js * DropBox, GDrive and GitHub modules now look the same. +* Fixed bug with pressing Esc when menu showed. +We could not to now, when key was pressed becaouse of +stopPropogation function in jquery.contextMenu module. + 2012.12.12, Version 0.1.8 diff --git a/lib/client/menu.js b/lib/client/menu.js index 5a65ad6a..e8db3194 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -140,7 +140,7 @@ var CloudCommander, Util, DOM, $; // define the elements of the menu items: getAllItems({ 'View' : Util.retExec(showEditor, true), - 'Edit' : Util.retExec(showEditor), + 'Edit' : Util.retExec(showEditor, false), 'Delete' : Util.retExec(DOM.promptRemoveCurrent), 'Upload to' : getUploadToItem( ['GitHub', 'GDrive', 'DropBox'] ), 'Download' : function(key, opt){ @@ -246,8 +246,7 @@ var CloudCommander, Util, DOM, $; /* if document.onclick was set up * before us, it's best time to call it */ - if(typeof lFunc_f === 'function') - lFunc_f(); + Util.exec(lFunc_f); KeyBinding.set(); } diff --git a/lib/client/menu/contextMenu.js b/lib/client/menu/contextMenu.js index 2b4da541..53506e6d 100644 --- a/lib/client/menu/contextMenu.js +++ b/lib/client/menu/contextMenu.js @@ -106,7 +106,7 @@ var // currently active contextMenu trigger // x and y are given (by mouse event) var triggerIsFixed = opt.$trigger.parents().andSelf() .filter(function() { - return $(this).css('position') == "fixed"; + return $($this).css('position') == "fixed"; }).length; if (triggerIsFixed) { @@ -428,7 +428,7 @@ var // currently active contextMenu trigger e.preventDefault(); } - e.stopPropagation(); + //e.stopPropagation(); }, key: function(e) { var opt = $currentTrigger.data('contextMenu') || {}, diff --git a/lib/util.js b/lib/util.js index 0c9def50..2defb049 100644 --- a/lib/util.js +++ b/lib/util.js @@ -243,7 +243,9 @@ var Util, exports; */ Util.retExec = function(pCallBack, pArg){ return function(pArgument){ - Util.exec(pCallBack, pArg || pArgument); + if( !Util.isUndefined(pArg) ) + pArgument = pArg; + Util.exec(pCallBack, pArgument); }; };