mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
fix(view) overlay: show config only ones when click on button
This commit is contained in:
parent
fc5512f80f
commit
5278d5bc5b
1 changed files with 15 additions and 8 deletions
|
|
@ -19,14 +19,13 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
beforeShow : function(callback) {
|
||||
Images.hide();
|
||||
Key.unsetBind();
|
||||
DOM.show(Overlay);
|
||||
|
||||
showOverlay();
|
||||
Util.exec(callback);
|
||||
},
|
||||
beforeClose : function(callback) {
|
||||
Key.setBind();
|
||||
Util.exec(callback);
|
||||
DOM.hide(Overlay);
|
||||
hideOverlay();
|
||||
},
|
||||
afterShow : function(callback) {
|
||||
if (!FocusWas) {
|
||||
|
|
@ -82,7 +81,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
Config.parent = Overlay = DOM.load({
|
||||
id : 'js-view',
|
||||
name : 'div',
|
||||
className : 'view-overlay fancybox-overlay fancybox-overlay-fixed'
|
||||
className : 'fancybox-overlay fancybox-overlay-fixed'
|
||||
});
|
||||
|
||||
Events.addClick(Util.exec.with(onOverLayClick, Overlay), Overlay);
|
||||
|
|
@ -288,16 +287,16 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
files = Util.slice(Info.files),
|
||||
filesPassive= Util.slice(Info.filesPassive),
|
||||
position = CloudCmd.MousePosition,
|
||||
element = document.elementFromPoint(position.x, position.y),
|
||||
element = event.target,
|
||||
isOverlay = element === overlay;
|
||||
|
||||
if (isOverlay) {
|
||||
DOM.hide(overlay);
|
||||
hideOverlay();
|
||||
element = DOM.getCurrentByPosition(position);
|
||||
|
||||
if (element) {
|
||||
isFiles = !~files.indexOf(element);
|
||||
isFilesPassive = !~filesPassive.indexOf(element);
|
||||
isFiles = ~files.indexOf(element);
|
||||
isFilesPassive = ~filesPassive.indexOf(element);
|
||||
|
||||
if (isFiles || isFilesPassive) {
|
||||
isCurrent = DOM.isCurrentFile(element);
|
||||
|
|
@ -311,6 +310,14 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
}
|
||||
}
|
||||
|
||||
function hideOverlay() {
|
||||
DOM.removeClass(Overlay, 'view-overlay');
|
||||
}
|
||||
|
||||
function showOverlay() {
|
||||
DOM.addClass(Overlay, 'view-overlay');
|
||||
}
|
||||
|
||||
function listener(event) {
|
||||
var keyCode = event.keyCode,
|
||||
ESC = Key.ESC;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue