mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
feature(rest) write: url, data, callback / url, callback
This commit is contained in:
parent
edc14b5f29
commit
c2f44c061a
2 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue