From ce5a9f67963db527f8341ac590de60b160735433 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 11 Jun 2015 10:04:03 -0400 Subject: [PATCH] feature(view) add contextmenu to overlayclick --- lib/client/view.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/client/view.js b/lib/client/view.js index 8f6299a2..07dd0550 100644 --- a/lib/client/view.js +++ b/lib/client/view.js @@ -59,7 +59,7 @@ var CloudCmd, Util, DOM, CloudFunc, $; View.hide = hide; function init() { - var func = CallBack || Util.exec.with(show, null); + var func = CallBack || Util.exec.with(show, null); Loading = true; @@ -79,7 +79,10 @@ var CloudCmd, Util, DOM, CloudFunc, $; className : 'fancybox-overlay fancybox-overlay-fixed' }); - Events.addClick(Util.exec.with(onOverLayClick, Overlay), Overlay); + ['click', 'contextmenu'].forEach(function(name) { + Events.add(name, Overlay, onOverLayClick); + }); + Events.addKey(listener); } @@ -285,12 +288,12 @@ var CloudCmd, Util, DOM, CloudFunc, $; }); } - function onOverLayClick(overlay, event) { + function onOverLayClick(event) { var isCurrent, isFiles, isFilesPassive, files = Info.files, filesPassive = Info.filesPassive, element = event.target, - isOverlay = element === overlay, + isOverlay = element === Overlay, position = { x: event.clientX, y: event.clientY