feature(view) add ability to view next/previous image

This commit is contained in:
coderaiser 2015-07-06 08:53:33 -04:00
parent 70c6d2b970
commit 043bf9c874

View file

@ -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('')
});
});
}