From 43cc5d97350e0efdd85764f1f38631abeb3e894a Mon Sep 17 00:00:00 2001
From: florian <f.spreckelsen@inidscale.com>
Date: Tue, 10 Oct 2023 14:16:05 +0200
Subject: [PATCH] ENH: Better notification for overfull dropdown menu

---
 src/core/js/edit_mode.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/core/js/edit_mode.js b/src/core/js/edit_mode.js
index c85298c1..fbf138af 100644
--- a/src/core/js/edit_mode.js
+++ b/src/core/js/edit_mode.js
@@ -981,7 +981,7 @@ var edit_mode = new function () {
                 let time = dateandtime[1];
                 // subseconds are stored in the subsec attribue of the input element
                 result = "<span><input type='date' value='" + date + "'/>" +
-                    "<input type='time' subsec='"+dateandtime[2]+"' value='" + time + "'/></span>";
+                    "<input type='time' subsec='" + dateandtime[2] + "' value='" + time + "'/></span>";
             } else if (property.value && ((property.name || "").toLowerCase() == "year" || (date.match(/-/g) || []).length == 0)) {
                 // Year
                 result = "<input type='number' value='" + date + "'/>";
@@ -1018,7 +1018,7 @@ var edit_mode = new function () {
                 options.then((_options) => {
                     // The options might not include all entites (if there are
                     // many). Include the property value if it is missing.
-                    if (property.value!="" && -1 == _options.map((e) => {
+                    if (property.value != "" && -1 == _options.map((e) => {
                             return e.value
                         }).indexOf(property.value)) {
                         _options = _options.concat([$(`<option value="${property.value}">ID: ${property.value}</option>`)[0]])
@@ -1893,7 +1893,9 @@ var edit_mode = new function () {
 
         if (n_entities > max_options || n_files > max_options) {
             // add notification that not all entities are shown
-            options = [$(`<option disabled=true value="NA"/>`).text('Dropdown only shows selection of possible entities!')[0]].concat(options);
+            options = [$(`<option disabled=true value="NA"/>`).text(
+                `More than ${max_options} possible options; showing only a subset. You may need to enter the id manually.`
+            )[0]].concat(options);
         }
         return options;
     }
-- 
GitLab