mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 10:38:26 +00:00
fix(view) showImage: left key button in image view (#164)
This commit is contained in:
parent
f17d5b149a
commit
cf4a273e83
1 changed files with 6 additions and 15 deletions
|
|
@ -204,11 +204,6 @@ function hide() {
|
|||
}
|
||||
|
||||
function showImage(href, prefixUrl) {
|
||||
const title = Info.name;
|
||||
const excludeCurrent = (path) => {
|
||||
return path !== Info.path;
|
||||
};
|
||||
|
||||
const makeTitle = (path) => {
|
||||
return {
|
||||
href: prefixUrl + path,
|
||||
|
|
@ -216,18 +211,16 @@ function showImage(href, prefixUrl) {
|
|||
};
|
||||
};
|
||||
|
||||
const first = {
|
||||
href,
|
||||
title,
|
||||
};
|
||||
|
||||
const names = Info.files
|
||||
.map(DOM.getCurrentPath)
|
||||
.filter(isImage)
|
||||
.filter(excludeCurrent)
|
||||
.filter(isImage);
|
||||
|
||||
const titles = names
|
||||
.map(makeTitle);
|
||||
|
||||
const index = names.indexOf(Info.path);
|
||||
const config = Object.assign({}, Config, {
|
||||
index,
|
||||
autoSize : true,
|
||||
type : 'image',
|
||||
prevEffect : 'none',
|
||||
|
|
@ -240,9 +233,7 @@ function showImage(href, prefixUrl) {
|
|||
}
|
||||
});
|
||||
|
||||
const allNames = [first].concat(names);
|
||||
|
||||
$.fancybox.open(allNames, config);
|
||||
$.fancybox.open(titles, config);
|
||||
}
|
||||
|
||||
function isImage(name) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue