Przeglądaj źródła

#248 Fix after jQuery update

Alex Trofimov 11 lat temu
rodzic
commit
fd3868da33
1 zmienionych plików z 17 dodań i 15 usunięć
  1. 17 15
      inc/js/classes/BxDolUploader.js

+ 17 - 15
inc/js/classes/BxDolUploader.js

@@ -136,22 +136,24 @@ BxDolUploaderSimple.prototype.restoreGhosts = function () {
         if (!$this.isMultiple())
             $('#' + $this._sResultContainerId + ' .bx-uploader-ghost').remove();
 
-        $.each(aData, function(iFileId, oVars) {
-            if ($('#bx-uploader-file-' + iFileId).length > 0)
-                return;
-            var sHTML;
-            if (typeof $this._sTemplateGhost == 'object')
-                sHTML = $this._sTemplateGhost[iFileId];
-            else
-                sHTML = $this._sTemplateGhost;
-            for (var i in oVars)
-                sHTML = sHTML.replace (new RegExp('{'+i+'}', 'g'), oVars[i]);
-            
-            $('#' + $this._sResultContainerId).prepend(sHTML);
-
-            $('#bx-uploader-file-' + iFileId + ' .bx-uploader-ghost-preview img').hide().fadeIn(1000);
+        if ('object' === typeof(aData)) {
+            $.each(aData, function(iFileId, oVars) {
+                if ($('#bx-uploader-file-' + iFileId).length > 0)
+                    return;
+                var sHTML;
+                if (typeof $this._sTemplateGhost == 'object')
+                    sHTML = $this._sTemplateGhost[iFileId];
+                else
+                    sHTML = $this._sTemplateGhost;
+                for (var i in oVars)
+                    sHTML = sHTML.replace (new RegExp('{'+i+'}', 'g'), oVars[i]);
+                
+                $('#' + $this._sResultContainerId).prepend(sHTML);
+
+                $('#bx-uploader-file-' + iFileId + ' .bx-uploader-ghost-preview img').hide().fadeIn(1000);
 
-        });
+            });
+        }
     });
 }