refactor(view) isImage: $.fancybox -> Util.checkExt

This commit is contained in:
coderaiser 2014-06-05 05:33:26 -04:00
parent 50dbc67ee1
commit 52b780eb92

View file

@ -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;
}