[report] Fix JS error on document picker statement chooser
@@ -4982,6 +4982,7 @@ $(document).ready(function () {
huePubSub.subscribe('dashboard.confirm.document', function () {
$('#addDocumentFacetDemiModal').modal('hide');
if (selectedWidget != null) {
+ if (searchViewModel.tempDocument.parsedStatements().length > 1) {
// there's no programmatic way to get the selected index from the Selectize API...
var $dropdown = $('.temp-document-statement')[0].selectize.$dropdown_content;
if ($dropdown.find('.selected').length > 1) {
@@ -4990,6 +4991,7 @@ $(document).ready(function () {
else {
searchViewModel.tempDocument.selectedStatementId($dropdown.find('.selected').index());
}
+ }
searchViewModel.collection.selectedDocument({
uuid: searchViewModel.tempDocument.uuid(),
statement_id: searchViewModel.tempDocument.selectedStatementId(),
