mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature(view) rm image template
This commit is contained in:
parent
b3406c5957
commit
583755570f
2 changed files with 7 additions and 24 deletions
|
|
@ -1 +0,0 @@
|
|||
<img src="{{ src }}" alt="{{ name }}"></img>
|
||||
|
|
@ -84,11 +84,13 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
Images.showLoad();
|
||||
path = CloudFunc.FS + Info.path;
|
||||
|
||||
if (isImage(path))
|
||||
getImageElement(path, function(element) {
|
||||
$.fancybox.open(element, Config);
|
||||
});
|
||||
else if (isMusic(path))
|
||||
if (isImage(path)) {
|
||||
config = Util.copyObj({
|
||||
autoSize: true
|
||||
}, Config);
|
||||
|
||||
$.fancybox.open(path, config);
|
||||
} else if (isMusic(path))
|
||||
getMusicElement(path, function(element) {
|
||||
$.fancybox.open(element, {
|
||||
beforeShow: musicBeforeShow
|
||||
|
|
@ -128,24 +130,6 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
return isMatch;
|
||||
}
|
||||
|
||||
function getImageElement(src, callback) {
|
||||
CloudCmd.getTemplate(TemplateImage, 'view/image', function(template) {
|
||||
var rendered, element;
|
||||
|
||||
if (!TemplateImage)
|
||||
TemplateImage = template;
|
||||
|
||||
rendered = Util.render(TemplateImage, {
|
||||
src: src,
|
||||
name: Info.name
|
||||
});
|
||||
|
||||
element = $(rendered);
|
||||
|
||||
Util.exec(callback, element);
|
||||
});
|
||||
}
|
||||
|
||||
function getMusicElement(src, callback) {
|
||||
CloudCmd.getTemplate(TemplateAudio, 'view/audio', function(template) {
|
||||
var rendered, element;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue