mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(view) showImage: prefix
This commit is contained in:
parent
935612bfb5
commit
8b692e0e88
1 changed files with 10 additions and 8 deletions
|
|
@ -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
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue