From 91a7a15a972517e6e9ae8e764c775810bf35b27f Mon Sep 17 00:00:00 2001
From: Vincent Bechu <vincent.bechu@nexedi.com>
Date: Tue, 26 Sep 2017 08:00:46 +0000
Subject: [PATCH] [erp5_officejs] Bootloader create global only one time

Test passed :

https://nexedijs.erp5.net/#/test_result_module/20170926-4163AF53

/reviewed-on https://lab.nexedi.com/nexedi/erp5/merge_requests/414
---
 .../web_page_module/gadget_officejs_bootloader_js.js          | 4 +++-
 .../web_page_module/gadget_officejs_bootloader_js.xml         | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.js
index 0d7a8225fe..607ed0b245 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.js
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.js
@@ -51,7 +51,9 @@ var repair = false;
         state = {},
         element_list =
           gadget.element.querySelectorAll('[data-install-configuration]');
-      window.Bootloader = gadget;
+      if (window.Bootloader === undefined) {
+        window.Bootloader = gadget;
+      }
 
       for (i = 0; i < element_list.length; i += 1) {
         state[element_list[i].getAttribute('data-install-configuration')] =
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.xml
index 4be2fe1ba3..2dede44859 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bootloader_js.xml
@@ -236,7 +236,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>961.57945.44138.39099</string> </value>
+                <value> <string>962.14302.13214.21742</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -254,7 +254,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1504605705.8</float>
+                        <float>1506412140.67</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
-- 
2.30.9