feature(rest) write: url, data, callback / url, callback

This commit is contained in:
coderaiser 2014-10-05 08:03:21 -04:00
parent edc14b5f29
commit c2f44c061a
2 changed files with 8 additions and 1 deletions

View file

@ -464,7 +464,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
path += type;
if (name)
RESTful.write(path, null, function() {
RESTful.write(path, function() {
CloudCmd.refresh(null, null, function() {
var current = DOM.getCurrentFileByName(name);

View file

@ -31,6 +31,13 @@ var Util, DOM, CloudFunc, CloudCmd;
};
this.write = function(url, data, callback) {
var isFunc = Util.type.function(data);
if (!callback && isFunc) {
callback = data;
data = null;
}
sendRequest({
method : 'PUT',
url : CloudFunc.FS + url,