mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
refactor(view) isImage: $.fancybox -> Util.checkExt
This commit is contained in:
parent
50dbc67ee1
commit
52b780eb92
1 changed files with 13 additions and 2 deletions
|
|
@ -123,7 +123,8 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
|
||||
case 'image':
|
||||
config = Util.copyObj({
|
||||
autoSize : true
|
||||
autoSize : true,
|
||||
type : 'image'
|
||||
}, Config);
|
||||
|
||||
$.fancybox.open(path, config);
|
||||
|
|
@ -161,7 +162,17 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
}
|
||||
|
||||
function isImage(name) {
|
||||
var isMatch = $.fancybox.isImage(name);
|
||||
var isMatch;
|
||||
|
||||
isMatch = Util.checkExt(name, [
|
||||
'jp(e|g|eg)',
|
||||
'gif',
|
||||
'png',
|
||||
'bmp',
|
||||
'webp',
|
||||
'svg',
|
||||
'ico'
|
||||
]);
|
||||
|
||||
return isMatch;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue