diff --git a/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts b/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts index 62bf7c87cf..92ea84c5d0 100644 --- a/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts +++ b/api/js/etemplate/Et2Vfs/Et2VfsSelectDialog.ts @@ -329,6 +329,23 @@ export class Et2VfsSelectDialog return value; } + protected localSearch(search : string, searchOptions : object, localOptions : FileInfo[] = []) : Promise + { + return super.localSearch(search, {...searchOptions, mime: this.mime}, localOptions); + } + + public searchMatch(search : string, searchOptions : Object, option : FileInfo) : boolean + { + let result = super.searchMatch(search, searchOptions, option); + + // Add in local mime check + if(result && searchOptions.mime) + { + result = result && option.mime.match(searchOptions.mime); + } + return result; + } + remoteSearch(search : string, options : object) : Promise { // Include a limit, even if options don't, to avoid massive lists breaking the UI @@ -892,7 +909,7 @@ export class Et2VfsSelectDialog customElements.define("et2-vfs-select-dialog", Et2VfsSelectDialog); -export interface FileInfo extends SearchResult +export type FileInfo = SearchResult & { mime : string, isDir : boolean,