Skip to content
Snippets Groups Projects
Commit 737a1ff6 authored by bbaer's avatar bbaer
Browse files

Fixed error where custom values wouldn't be saved, no not found for non pedantic

parent 3a748406
No related branches found
No related tags found
1 merge request!23Fixed error where custom values wouldn't be saved, no not found for non pedantic
......@@ -74,9 +74,13 @@ var QfqNS = QfqNS || {};
suggestion: function (obj) {
return "<div>" + n.TypeAhead.htmlEncode(obj.value) + "</div>";
},
notFound: function (obj) {
return "<div>'" + n.TypeAhead.htmlEncode(obj.query) + "' not found";
}
// No message if field is not set to pedantic.
notFound: (function($_) {
return function (obj) {
if (!!$_.data('typeahead-pedantic'))
return "<div>'" + n.TypeAhead.htmlEncode(obj.query) + "' not found";
};
})($element)
}
});
......@@ -115,6 +119,12 @@ var QfqNS = QfqNS || {};
$shadowElement.val('');
};
})($shadowElement));
} else {
$element.bind('typeahead:change', function (event, suggestion) {
var $shadowElement = n.TypeAhead.getShadowElement($(event.delegateTarget));
// If none pendatic, suggestion key might not exist, so use suggestion instead.
$shadowElement.val(suggestion.key || suggestion);
});
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment