Skip to content

Commit

Permalink
Support show-hints-on-focus for language picker
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjmchugh committed Oct 29, 2024
1 parent f974a4c commit 89fdb80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions schemas/iso19139/src/main/plugin/iso19139/layout/layout.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@
<xsl:with-param name="cls" select="local-name()"/>
<xsl:with-param name="xpath" select="$xpath"/>
<xsl:with-param name="type" select="gn-fn-iso19139:getCodeListType(name())"/>
<xsl:with-param name="directiveAttributes">
<xsl:copy-of select="gn-fn-metadata:getFieldDirective($editorConfig, name(),name(*[@codeListValue]), $xpath)"/>
</xsl:with-param>
<xsl:with-param name="name"
select="if ($isEditing) then concat(*/gn:element/@ref, '_codeListValue') else ''"/>
<xsl:with-param name="editInfo" select="*/gn:element"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@
restrict: "A",
link: function (scope, element, attrs) {
scope.prefix = attrs["prefix"] || "";
scope.showHintsOnFocus = attrs.showHintsOnFocus === "true"; // displays all the values on focus, default shows only the selected value
element.attr("placeholder", "...");
element.on("focus", function () {
$http
Expand Down Expand Up @@ -945,7 +946,8 @@
$(element).typeahead(
{
minLength: 0,
highlight: true
highlight: true,
showHintsOnFocus: scope.showHintsOnFocus
},
{
name: "isoLanguages",
Expand All @@ -958,6 +960,10 @@
}
}
);
// Since the typeahead is initialized on focus the first focus will not trigger the hints
// So we blur then refocus to trigger the hints
$(element).blur();
$(element).focus();
});
element.unbind("focus");
});
Expand Down

0 comments on commit 89fdb80

Please sign in to comment.