mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(view) add ability to view next/previous image
This commit is contained in:
parent
70c6d2b970
commit
043bf9c874
1 changed files with 38 additions and 9 deletions
|
|
@ -184,18 +184,43 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
$.fancybox.close();
|
||||
}
|
||||
|
||||
function showImage(path) {
|
||||
var config;
|
||||
function showImage() {
|
||||
var config,
|
||||
current = Info.name,
|
||||
files = [].slice.call(Info.files),
|
||||
names = DOM.getSelectedNames(files)
|
||||
.filter(isImage)
|
||||
.filter(function(name) {
|
||||
return name !== current;
|
||||
}).map(function(name) {
|
||||
return {
|
||||
href: name,
|
||||
title: name
|
||||
};
|
||||
});
|
||||
|
||||
names.unshift({
|
||||
href: current,
|
||||
title: current
|
||||
});
|
||||
|
||||
config = Util.copyObj({
|
||||
}, Config);
|
||||
|
||||
config = Util.copyObj(config, {
|
||||
autoSize : true,
|
||||
type : 'image'
|
||||
type : 'image',
|
||||
prevEffect : 'none',
|
||||
nextEffect : 'none',
|
||||
arrows : true,
|
||||
keys : true,
|
||||
helpers : {
|
||||
overlay : null,
|
||||
title : {}
|
||||
}
|
||||
});
|
||||
|
||||
$.fancybox.open(path, config);
|
||||
$.fancybox.open(names, config);
|
||||
}
|
||||
|
||||
function isImage(name) {
|
||||
|
|
@ -296,11 +321,15 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
DOM.load.css(prefix + '/css/view.css', callback);
|
||||
|
||||
DOM.load.style({
|
||||
id : 'view-css',
|
||||
inner : '#fancybox-loading {' +
|
||||
'display: none' +
|
||||
'}'
|
||||
});
|
||||
id : 'view-inlince-css',
|
||||
inner : [
|
||||
'.fancybox-title-float-wrap .child {',
|
||||
'-webkit-border-radius: 0;',
|
||||
'-moz-border-radius: 0;',
|
||||
'border-radius: 0;',
|
||||
'}'
|
||||
].join('')
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue