Commit 4c277484 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: relation field: do not crash in readonly mode

parent f34ae161
...@@ -555,6 +555,9 @@ ...@@ -555,6 +555,9 @@
next_event, next_event,
active_index, active_index,
ul = gadget.element.querySelector(".search_ul"); ul = gadget.element.querySelector(".search_ul");
if (ul === null) {
return;
}
if (evt.key === "ArrowDown" || evt.key === "ArrowUp") { if (evt.key === "ArrowDown" || evt.key === "ArrowUp") {
if (ul.childNodes.length > 0) { if (ul.childNodes.length > 0) {
for (i = 0; i < ul.childNodes.length; i += 1) { for (i = 0; i < ul.childNodes.length; i += 1) {
...@@ -614,6 +617,9 @@ ...@@ -614,6 +617,9 @@
var gadget = this, var gadget = this,
i, i,
ul = gadget.element.querySelector(".search_ul"); ul = gadget.element.querySelector(".search_ul");
if (ul === null) {
return;
}
if (evt.target.tagName.toLowerCase() === 'li') { if (evt.target.tagName.toLowerCase() === 'li') {
for (i = 0; i < ul.childNodes.length; i += 1) { for (i = 0; i < ul.childNodes.length; i += 1) {
ul.childNodes[i].classList.remove('active'); ul.childNodes[i].classList.remove('active');
......
...@@ -69,7 +69,9 @@ ...@@ -69,7 +69,9 @@
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
...@@ -240,7 +242,7 @@ ...@@ -240,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.36268.43767.1126</string> </value> <value> <string>1020.33621.37473.62976</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +262,7 @@ ...@@ -260,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1603726868.97</float> <float>1730996837.75</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