From d5ec4641c3670a4a39e0e0180c9671da3e026e93 Mon Sep 17 00:00:00 2001
From: Cerdic <cedric@yterium.com>
Date: Sun, 16 Nov 2008 21:57:05 +0000
Subject: [PATCH] report de [13206] et [13207]

---
 prive/javascript/async_upload.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/prive/javascript/async_upload.js b/prive/javascript/async_upload.js
index 4fecb35c59..0941e9fbf1 100644
--- a/prive/javascript/async_upload.js
+++ b/prive/javascript/async_upload.js
@@ -57,17 +57,21 @@ function async_upload_article_edit(res,s,jForm){
       if(!res) return true;
       var cont;
       //verify if a new document or a customized vignette
-      var anchor = jQuery(res.find(">a:first[@id^=document]"));
-			if(jQuery("#"+anchor.attr('id')).size()) {
-				cont = jQuery("#"+anchor.attr('id')).next().next().html(anchor.next().next().html());
+      var bloc = jQuery(res.find(">div:first[@id^=document]"));
+			if(jQuery("#"+bloc.attr('id')).size()) {
+				cont = jQuery("#"+bloc.attr('id')).html(bloc.html());
 			} else {
 	      //add a class to new documents
 	      res.
 	      find(">div[@class]")
 	      .addClass("documents_added")
 	      .css("display","none");
-	      if (jForm.find("input[@name='arg']").val().search("/0/image")!=-1)
+	      if (jForm.find("input[@name='arg']").val().search("/0/image")!=-1){
 	        cont = jQuery("#liste_images");
+	        // cas de l'interface document unifiee
+	        if (!cont.length)
+		        cont = jQuery("#liste_documents");
+	      }
 	      else
 	        cont = jQuery("#liste_documents");
 	      cont
-- 
GitLab