- LSdefault :: checkAjaxReturn() : Correction de la m├ęthode et ajout du support des...
authorBenjamin Renard <brenard@easter-eggs.com>
Sun, 9 Nov 2008 23:18:35 +0000 (23:18 +0000)
committerBenjamin Renard <brenard@easter-eggs.com>
Sun, 9 Nov 2008 23:18:35 +0000 (23:18 +0000)
trunk/includes/js/LSdefault.js

index 9edbe29..baba7a0 100644 (file)
@@ -57,20 +57,24 @@ var LSdefault = new Class({
     },
 
     checkAjaxReturn: function(data) {
     },
 
     checkAjaxReturn: function(data) {
-      if (typeof(data) == 'object') {
-        if (typeof(data.imgload) != "undefined") {
+      if ($type(data) == 'object') {
+        if ($type(data.imgload)) {
           this.loadingImgHide(data.imgload);
         }
         else {
           this.loadingImgHide();
         }
         
           this.loadingImgHide(data.imgload);
         }
         else {
           this.loadingImgHide();
         }
         
-        if (typeof(data.LSdebug) != "undefined") {
+        if ($type(data.LSdebug)) {
           LSdebug(data.LSdebug);
           this.displayDebug(data.LSdebug);
         }
         
           LSdebug(data.LSdebug);
           this.displayDebug(data.LSdebug);
         }
         
-        if (typeof(data.LSerror) != "undefined") {
+        if ($type(data.LSinfos)) {
+          this.displayInfos(data.LSinfos);
+        }
+        
+        if ($type(data.LSerror)) {
           this.displayError(data.LSerror);
           return;
         }
           this.displayError(data.LSerror);
           return;
         }