fix(dom) add max length for storage file

This commit is contained in:
coderaiser 2014-01-02 14:31:36 +00:00
parent a1e013f848
commit bfcd1cb2c7

View file

@ -1488,12 +1488,14 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
this.getCurrentData = function(pCallBack, pCurrentFile) {
var lParams,
lHash,
ONE_MEGABYTE = 1024 * 1024 * 1024,
lCurrentFile = pCurrentFile ? pCurrentFile : Cmd.getCurrentFile(),
lPath = DOM.getCurrentPath(lCurrentFile),
isDir = DOM.isCurrentIsDir(lCurrentFile),
lFunc = function(pData) {
var lExt = '.json',
var length = pData.length,
lExt = '.json',
lName = DOM.getCurrentName(lCurrentFile);
if (Util.isObject(pData)) {
@ -1503,7 +1505,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
lName += lExt;
}
if (lHash)
if (lHash && length < ONE_MEGABYTE)
DOM.saveDataToStorage(lPath, pData, lHash);
Util.exec(pCallBack, {