huqi 5 лет назад
Родитель
Сommit
e23330ddaf

+ 4 - 1
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js

@@ -592,15 +592,18 @@ MWF.xDesktop.Actions.RestActions.Callback = new Class({
 			   case "success":
 				   if (this.appendSuccess) this.appendSuccess(responseJSON);
 				   if (this.success) return this.success(responseJSON, responseText);
+				   return responseJSON;
 			       break;
 			   case "warn":
 				   MWF.xDesktop.notice("info", {x: "right", y:"top"}, responseJSON.errorMessage.join("\n"));
 				   
 				   if (this.appendSuccess) this.appendSuccess(responseJSON);
 				   if (this.success) return this.success(responseJSON);
-			       break;
+                   return responseJSON;
+				   break;
 			   case "error":
 				   return this.doError(null, responseText, responseJSON.message);
+                   return responseJSON;
 				   break;
 			}
 		}else{

+ 3 - 2
o2web/source/o2_core/o2/xScript/Environment.js

@@ -1502,8 +1502,8 @@ MWF.xScript.Environment = function(ev){
             }else{
                 optionsOrName.each(function(option){
                     _includeSingle.apply(this, [option]);
-                    if (callback) callback.apply(this);
                 }.bind(this));
+                if (callback) callback.apply(this);
             }
         }else{
             _includeSingle.apply(this, [optionsOrName , callback, async])
@@ -1523,7 +1523,8 @@ MWF.xScript.Environment = function(ev){
     //在异步调用结束后 执行 resolve.cb();
     //目前只有表单的queryload事件支持此方法。
     this.wait = function(){
-        resolve = {};
+        var _self = this;
+        resolve = {"cb":  _self.goon.bind(_self)};
         var setResolve = function(callback){
             resolve.cb = callback;
         }.bind(this);