Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/3729-Project-permissions-for-project-…
Browse files Browse the repository at this point in the history
…bound-users-of-foreign-project-might-be-created
  • Loading branch information
reckart authored Jan 18, 2023
2 parents 6f2985f + 4655f2d commit a6f84ea
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -136,6 +138,14 @@ private FormComponent<ReorderableTag> createEditableInput()
{
private static final long serialVersionUID = 7769511105678209462L;

@Override
public void renderHead(IHeaderResponse aResponse)
{
super.renderHead(aResponse);

aResponse.render(forReference(KendoChoiceDescriptionScriptReference.get()));
}

@Override
protected List<ReorderableTag> getChoices(String aInput)
{
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public List<HeaderItem> getDependencies()
return dependencies;
}

public static String applyTooltipScript()
{
return "(evt) => { applyTooltip(evt.sender.list) }";
}

public static IJQueryTemplate template()
{
return new IJQueryTemplate()
Expand All @@ -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 "<div title=\"#: data.description #\" "
+ "onmouseover=\"javascript:applyTooltip(this)\">"
+ "#: data.name #</div>\n";
StringBuilder sb = new StringBuilder();
sb.append("<span class='item-title' title='#: data.description #'>");
sb.append("${ data.name }");
sb.append("</span>");
return sb.toString();
}

@Override
Expand All @@ -104,7 +108,7 @@ public String getText()
// http://docs.telerik.com/kendo-ui/framework/templates/overview
// @formatter:off
StringBuilder sb = new StringBuilder();
sb.append("<span title='#: data.description #' onmouseover='javascript:applyTooltip(this)'>");
sb.append("<span class='item-title' title='#: data.description #'>");
sb.append("# if (data.reordered == 'true') { #");
sb.append("<b>${data.name}</b>");
sb.append("# } else { #");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function applyTooltip(aElement) {
return html;
}
});
setTimeout(function() { $(aElement).tooltip().mouseover();; }, 0);
setTimeout(function() { $(aElement).tooltip().mouseover(); }, 0);
}
}
catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
"<span title=\"#: data.description + '\\n\\n' + data.identifier #\" "
+ "onmouseover=\"javascript:applyTooltip(this)\">"
+ "#: data.uiLabel #</span>\n"));
}

@Override
Expand Down

0 comments on commit a6f84ea

Please sign in to comment.