From c1a7796843fbd9b3ad31810a874d9b7ffd1a3323 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 19 Nov 2013 12:09:52 +0000 Subject: [PATCH] feature(dom) add saveCurrentData --- lib/client/dom.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/client/dom.js b/lib/client/dom.js index 2ab3392b..02d12ca5 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1511,6 +1511,19 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; }); }; + + /** + * unified way to save current file content + * + * @pCallBack - function({data, name}) {} + * @pCurrentFile + */ + this.saveCurrentData = function(pUrl, pData, pCallBack, pQuery) { + RESTful.save(pUrl, pData, function() { + DOM.saveDataInCache(pUrl, pData); + }, pQuery); + }; + /** * unified way to get RefreshButton */