refactor(view) checkExtension -> isImage

This commit is contained in:
coderaiser 2014-01-02 14:42:52 +00:00
parent bfcd1cb2c7
commit 9b4d3cd6e7

View file

@ -75,7 +75,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
* function shows FancyBox
*/
function show(pData, pCallBack, pConfig) {
var lPath, lElement, lAfterFunc, lFunc, name,
var lPath, lElement, lAfterFunc, lFunc, name, isImage,
config = {};
if (!Loading) {
@ -98,9 +98,10 @@ var CloudCmd, Util, DOM, CloudFunc, $;
$.fancybox(lElement, config);
} else {
lPath = CloudFunc.FS + Info.path;
lPath = CloudFunc.FS + Info.path;
isImage = $.fancybox.isImage(lPath);
if (Util.checkExtension(lPath, ['png','jpg', 'gif','ico'])) {
if (isImage) {
$.fancybox.open({ href : lPath }, Config);
} else
Info.getData(function(pParams) {