diff --git a/resources/views/partials/entity_combobox.blade.php b/resources/views/partials/entity_combobox.blade.php new file mode 100644 index 000000000000..67cd39738844 --- /dev/null +++ b/resources/views/partials/entity_combobox.blade.php @@ -0,0 +1,28 @@ +var {{ $entityType }}Name = ''; + +${{ $entityType }}Select.combobox({ + highlighter: function (item) { + if (item.indexOf("{{ trans("texts.create_{$entityType}") }}") == 0) { + {{ $entityType }}Name = this.query; + return "{{ trans("texts.create_{$entityType}") }}: " + this.query; + } else { + var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&'); + return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) { + return '' + match + ''; + }) + } + }, + template: '