feauture(client) add unload event

This commit is contained in:
coderaiser 2013-07-11 16:15:20 +00:00
parent be2d0f9a81
commit fb1dcc4acc
2 changed files with 13 additions and 0 deletions

View file

@ -110,6 +110,8 @@ getJSONfromFileTable.
* feature(dom) add events.add array
* feauture(client) add unload event
2012.04.22, v0.2.0

View file

@ -151,6 +151,17 @@ var Util, DOM, CloudFunc, CloudCmd;
};
Util.ifExec(document.body.scrollIntoViewIfNeeded, lCallBack, lFunc);
DOM.Events.add(['unload', 'beforeunload'], function (pEvent) {
var lRet, lIsBind = Key.isBind();
if(!lIsBind) {
DOM.preventDefault(pEvent);
lRet = 'Please make sure that you saved all work.';
}
return lRet;
});
};
function initModules(pCallBack){