From 804f0aa6d3cac753c1bdd1c3e889659a2eacece3 Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Thu, 15 Dec 2022 18:55:05 +0100 Subject: [PATCH 1/3] #3640 - Prev/next annotation buttons sometimes hang - Fix the getPrev and getNext methods --- .../webanno/api/annotation/util/WebAnnoCasUtil.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/util/WebAnnoCasUtil.java b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/util/WebAnnoCasUtil.java index 01ca6777c48..f572f813681 100644 --- a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/util/WebAnnoCasUtil.java +++ b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/util/WebAnnoCasUtil.java @@ -367,7 +367,8 @@ public static T getNext(T aRef) return null; } - // First match is a hit? + // If the first annotation we hit is already the reference annotation, we can simply + // move on to the next one and are done. if (it.get() == aRef) { it.moveToNext(); return it.isValid() ? (T) it.get() : null; @@ -389,6 +390,7 @@ public static T getNext(T aRef) it.moveToNext(); return it.isValid() ? (T) it.get() : null; } + it.moveToNext(); } return null; @@ -405,7 +407,8 @@ public static T getPrev(T aRef) return null; } - // First match is a hit? + // If the first annotation we hit is already the reference annotation, we can simply + // move on to the previous one and are done. if (it.get() == aRef) { it.moveToPrevious(); return it.isValid() ? (T) it.get() : null; @@ -427,6 +430,7 @@ public static T getPrev(T aRef) it.moveToPrevious(); return it.isValid() ? (T) it.get() : null; } + it.moveToNext(); } return null; From 2b581cc51272bcd9e1f109a88ea1ade015a73052 Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Sat, 17 Dec 2022 14:42:51 +0100 Subject: [PATCH 2/3] #3634 - Dropdowns look odd - Fix styling of some combo boxes in KB wizard --- .../ukp/inception/ui/kb/project/GeneralSettingsPanel.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inception/inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/project/GeneralSettingsPanel.html b/inception/inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/project/GeneralSettingsPanel.html index 22d44cbd98a..e82ad93be87 100644 --- a/inception/inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/project/GeneralSettingsPanel.html +++ b/inception/inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/project/GeneralSettingsPanel.html @@ -38,7 +38,7 @@
- +
@@ -56,7 +56,7 @@
- +
From 7303f189a5882f305f4343abe1eeebb6f5b61051 Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Sat, 17 Dec 2022 14:44:53 +0100 Subject: [PATCH 3/3] #3634 - Dropdowns look odd - Also use KendoStyleUtils for the MultiValueConceptFeatureEditor --- .../src/main/ts/bootstrap/inception-custom.scss | 1 + .../ukp/inception/support/kendo/KendoStyleUtils.java | 5 +++-- .../ui/kb/feature/MultiValueConceptFeatureEditor.java | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/inception/inception-bootstrap/src/main/ts/bootstrap/inception-custom.scss b/inception/inception-bootstrap/src/main/ts/bootstrap/inception-custom.scss index b5ebf5da7db..1ce516f0290 100644 --- a/inception/inception-bootstrap/src/main/ts/bootstrap/inception-custom.scss +++ b/inception/inception-bootstrap/src/main/ts/bootstrap/inception-custom.scss @@ -24,6 +24,7 @@ html, body { width: 100%; display: flex; flex-direction: column; + overflow: hidden; } .page-header { diff --git a/inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/kendo/KendoStyleUtils.java b/inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/kendo/KendoStyleUtils.java index 4bab93fa5e0..9b42809f5a8 100644 --- a/inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/kendo/KendoStyleUtils.java +++ b/inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/kendo/KendoStyleUtils.java @@ -35,7 +35,7 @@ public static void autoDropdownWidth(JQueryBehavior aBehavior) aBehavior.setOption("open", join(" ", // "function(e) {", // " var listContainer = e.sender.list.closest('.k-popup');", // - " listContainer.width(Math.max($(window).width()*0.3+kendo.support.scrollbar(),300))", // + " listContainer.width(Math.max(window.innerWidth*0.3+kendo.support.scrollbar(),300))", // "}")); } @@ -49,7 +49,8 @@ public static void autoDropdownWidth(JQueryBehavior aBehavior) public static void autoDropdownHeight(JQueryBehavior aBehavior) { // - aBehavior.setOption("height", "Math.max($(window).height()*0.5,200)"); + aBehavior.setOption("height", join(" ", // + "Math.max(window.innerHeight*0.5,200)")); } /** diff --git a/inception/inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/feature/MultiValueConceptFeatureEditor.java b/inception/inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/feature/MultiValueConceptFeatureEditor.java index b91b6667b22..5f2cff5eb25 100644 --- a/inception/inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/feature/MultiValueConceptFeatureEditor.java +++ b/inception/inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/feature/MultiValueConceptFeatureEditor.java @@ -40,6 +40,7 @@ import de.tudarmstadt.ukp.inception.rendering.editorstate.FeatureState; import de.tudarmstadt.ukp.inception.schema.feature.FeatureSupport; import de.tudarmstadt.ukp.inception.schema.feature.FeatureSupportRegistry; +import de.tudarmstadt.ukp.inception.support.kendo.KendoStyleUtils; public class MultiValueConceptFeatureEditor extends ConceptFeatureEditor_ImplBase @@ -120,10 +121,12 @@ public void onConfigure(JQueryBehavior aBehavior) private void styleMultiSelect(JQueryBehavior aBehavior) { - aBehavior.setOption("autoWidth", true); + // aBehavior.setOption("autoWidth", true); + KendoStyleUtils.autoDropdownWidth(aBehavior); + // aBehavior.setOption("height", 300); + KendoStyleUtils.autoDropdownHeight(aBehavior); aBehavior.setOption("animation", false); aBehavior.setOption("delay", 250); - aBehavior.setOption("height", 300); } @Override @@ -186,6 +189,7 @@ public void onConfigure(JQueryBehavior aBehavior) // aBehavior.setOption("autoBind", false); // aBehavior.setOption("minLength", 1); // aBehavior.setOption("enforceMinLength", true); + aBehavior.setOption("tagTemplate", Options.asString( "