fix(view) showImage: prefix

This commit is contained in:
Brian McMichael 2016-02-26 11:30:05 -05:00 committed by coderaiser
parent 935612bfb5
commit 8b692e0e88

View file

@ -90,7 +90,8 @@ var CloudCmd, Util, DOM, CloudFunc, $;
*/
function show(data, options) {
var path, element, type,
config = {};
prefixUrl = CloudCmd.PREFIX + CloudFunc.apiURL + CloudFunc.FS,
config = {};
if (!Loading) {
Element = $('<div class="view" tabindex=0>');
@ -122,7 +123,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
} else {
Images.show.load();
path = CloudFunc.FS + Info.path;
path = prefixUrl + Info.path;
type = getType(path);
switch(type) {
@ -181,23 +182,24 @@ var CloudCmd, Util, DOM, CloudFunc, $;
$.fancybox.close();
}
function showImage() {
function showImage(path) {
var config,
current = Info.name,
files = [].slice.call(Info.files),
names = DOM.getFilenames(files)
prefixUrl = CloudCmd.PREFIX + CloudFunc.apiURL + CloudFunc.FS,
current = Info.name,
files = [].slice.call(Info.files),
names = DOM.getFilenames(files)
.filter(isImage)
.filter(function(name) {
return name !== current;
}).map(function(name) {
return {
href: name,
href: prefixUrl + name,
title: name
};
});
names.unshift({
href: current,
href: path,
title: current
});