diff --git a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/misc/ReorderableTagAutoCompleteField.java b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/misc/ReorderableTagAutoCompleteField.java index 2eccf438efc..f6c6dff5648 100644 --- a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/misc/ReorderableTagAutoCompleteField.java +++ b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/misc/ReorderableTagAutoCompleteField.java @@ -80,6 +80,9 @@ public void onConfigure(JQueryBehavior aBehavior) aBehavior.setOption("animation", false); aBehavior.setOption("footerTemplate", Options.asString("#: instance.dataSource.total() # items found")); + aBehavior.setOption("open", KendoChoiceDescriptionScriptReference.applyTooltipScript()); + aBehavior.setOption("dataBound", + KendoChoiceDescriptionScriptReference.applyTooltipScript()); KendoStyleUtils.keepDropdownVisibleWhenScrolling(aBehavior); KendoStyleUtils.autoDropdownHeight(aBehavior); diff --git a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/multistring/MultiSelectTextFeatureEditor.java b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/multistring/MultiSelectTextFeatureEditor.java index 983d9c3e747..2b12e35e06d 100644 --- a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/multistring/MultiSelectTextFeatureEditor.java +++ b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/multistring/MultiSelectTextFeatureEditor.java @@ -20,12 +20,14 @@ import static java.util.Collections.emptyList; import static java.util.stream.Collectors.toList; import static org.apache.commons.lang3.StringUtils.startsWithIgnoreCase; +import static org.apache.wicket.markup.head.JavaScriptHeaderItem.forReference; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.wicket.MarkupContainer; +import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.html.form.FormComponent; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.IModel; @@ -136,6 +138,14 @@ private FormComponent createEditableInput() { private static final long serialVersionUID = 7769511105678209462L; + @Override + public void renderHead(IHeaderResponse aResponse) + { + super.renderHead(aResponse); + + aResponse.render(forReference(KendoChoiceDescriptionScriptReference.get())); + } + @Override protected List getChoices(String aInput) { @@ -182,6 +192,9 @@ private void styleMultiSelect(JQueryBehavior aBehavior) aBehavior.setOption("animation", false); aBehavior.setOption("delay", 250); aBehavior.setOption("height", 300); + aBehavior.setOption("open", KendoChoiceDescriptionScriptReference.applyTooltipScript()); + aBehavior.setOption("dataBound", + KendoChoiceDescriptionScriptReference.applyTooltipScript()); } @SuppressWarnings("rawtypes") diff --git a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoChoiceDescriptionScriptReference.java b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoChoiceDescriptionScriptReference.java index 870ea887b79..d742c5adeea 100644 --- a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoChoiceDescriptionScriptReference.java +++ b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoChoiceDescriptionScriptReference.java @@ -66,6 +66,11 @@ public List getDependencies() return dependencies; } + public static String applyTooltipScript() + { + return "(evt) => { applyTooltip(evt.sender.list) }"; + } + public static IJQueryTemplate template() { return new IJQueryTemplate() @@ -75,12 +80,11 @@ public static IJQueryTemplate template() @Override public String getText() { - // Some docs on how the templates work in Kendo, in case we need - // more fancy dropdowns - // http://docs.telerik.com/kendo-ui/framework/templates/overview - return "
" - + "#: data.name #
\n"; + StringBuilder sb = new StringBuilder(); + sb.append(""); + sb.append("${ data.name }"); + sb.append(""); + return sb.toString(); } @Override @@ -104,7 +108,7 @@ public String getText() // http://docs.telerik.com/kendo-ui/framework/templates/overview // @formatter:off StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append(""); sb.append("# if (data.reordered == 'true') { #"); sb.append("${data.name}"); sb.append("# } else { #"); diff --git a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoChoiceDescriptionScriptReference.js b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoChoiceDescriptionScriptReference.js index 88ee64be213..96df3913e4f 100644 --- a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoChoiceDescriptionScriptReference.js +++ b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoChoiceDescriptionScriptReference.js @@ -39,7 +39,7 @@ function applyTooltip(aElement) { return html; } }); - setTimeout(function() { $(aElement).tooltip().mouseover();; }, 0); + setTimeout(function() { $(aElement).tooltip().mouseover(); }, 0); } } catch (e) { diff --git a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoComboboxTextFeatureEditor.java b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoComboboxTextFeatureEditor.java index 56a18e285c0..72f8eeeba41 100644 --- a/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoComboboxTextFeatureEditor.java +++ b/inception/inception-api-annotation/src/main/java/de/tudarmstadt/ukp/inception/annotation/feature/string/KendoComboboxTextFeatureEditor.java @@ -136,6 +136,8 @@ public void onConfigure(JQueryBehavior aBehavior) super.onConfigure(aBehavior); aBehavior.setOption("animation", false); aBehavior.setOption("delay", 0); + aBehavior.setOption("open", + KendoChoiceDescriptionScriptReference.applyTooltipScript()); } @Override 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 5f2cff5eb25..e117a1a9ca0 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 @@ -27,7 +27,6 @@ import org.apache.wicket.spring.injection.annot.SpringBean; import com.googlecode.wicket.jquery.core.JQueryBehavior; -import com.googlecode.wicket.jquery.core.Options; import com.googlecode.wicket.jquery.core.template.IJQueryTemplate; import com.googlecode.wicket.kendo.ui.form.multiselect.lazy.MultiSelect; import com.googlecode.wicket.kendo.ui.renderer.ChoiceRenderer; @@ -189,12 +188,6 @@ public void onConfigure(JQueryBehavior aBehavior) // aBehavior.setOption("autoBind", false); // aBehavior.setOption("minLength", 1); // aBehavior.setOption("enforceMinLength", true); - - aBehavior.setOption("tagTemplate", - Options.asString( - "" - + "#: data.uiLabel #\n")); } @Override