Commit 1c9418ca authored by Roque's avatar Roque

erp5_officejs: fix promise queue and declare util gadget in html

parent 513ba454
...@@ -275,39 +275,42 @@ ...@@ -275,39 +275,42 @@
} }
} }
queue if (modification_dict.hasOwnProperty("portal_type")) {
.push(function () { queue
return gadget.declareGadget("gadget_officejs_common_util.html"); .push(function () {
}) return gadget.getDeclaredGadget("common_util");
.push(function (gadget_utils) { })
return gadget_utils.getViewAndActionDict(modification_dict.portal_type, .push(function (gadget_utils) {
modification_dict.jio_key); return gadget_utils.getViewAndActionDict(modification_dict.portal_type,
}) modification_dict.jio_key);
.push(function (view_action_dict) { })
return RSVP.all([ .push(function (view_action_dict) {
getElementList(gadget, view_action_dict.view_list), return RSVP.all([
getElementList(gadget, view_action_dict.action_list) getElementList(gadget, view_action_dict.view_list),
]); getElementList(gadget, view_action_dict.action_list)
}) ]);
.push(function (view_action_list) { })
var dl_element, .push(function (view_action_list) {
dl_fragment = document.createDocumentFragment(); var dl_element,
dl_element = gadget.element.querySelector("dl"); dl_fragment = document.createDocumentFragment();
while (dl_element.firstChild) { dl_element = gadget.element.querySelector("dl");
dl_element.removeChild(dl_element.firstChild); while (dl_element.firstChild) {
} dl_element.removeChild(dl_element.firstChild);
if (view_action_list[0].length > 0) { }
appendDt(dl_fragment, "VIEWS", 'eye', if (view_action_list[0].length > 0) {
view_action_list[0]); appendDt(dl_fragment, "VIEWS", 'eye',
dl_element.appendChild(dl_fragment); view_action_list[0]);
} dl_element.appendChild(dl_fragment);
if (view_action_list[1].length > 0) { }
appendDt(dl_fragment, "ACTIONS", 'cogs', if (view_action_list[1].length > 0) {
view_action_list[1]); appendDt(dl_fragment, "ACTIONS", 'cogs',
dl_element.appendChild(dl_fragment); view_action_list[1]);
} dl_element.appendChild(dl_fragment);
return queue; }
}); });
}
return queue;
}) })
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
......
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>979.51953.14282.5120</string> </value> <value> <string>979.52132.14300.25702</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1573729132.16</float> <float>1573740764.23</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -64,6 +64,11 @@ ...@@ -64,6 +64,11 @@
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_ojs_panel.js" type="text/javascript"></script> <script src="gadget_erp5_ojs_panel.js" type="text/javascript"></script>
<div data-gadget-url="gadget_officejs_common_util.html"
data-gadget-scope="common_util"
data-gadget-sandbox="public">
</div>
</head> </head>
<body> <body>
......
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>vincent</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.45561.47559.9591</string> </value> <value> <string>975.50798.33418.15411</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1515509919.32</float> <float>1573739234.08</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment