Merge "Allow gadget/browser extension extensibility of empty search state"

This commit is contained in:
jenkins-bot 2024-08-26 16:51:06 +00:00 committed by Gerrit Code Review
commit 43c6c7f95c
2 changed files with 8 additions and 0 deletions

View file

@ -27,6 +27,7 @@
@blur="onBlur"
>
<template #default>
<div ref="emptyState">empty</div>
<input
type="hidden"
name="title"
@ -185,6 +186,7 @@ module.exports = exports = defineComponent( {
restClient.fetchByTitle( query, 10, this.showDescription ),
true
);
this.$refs.emptyState.innerHTML = '';
},
/**
@ -270,6 +272,9 @@ module.exports = exports = defineComponent( {
this.disableTransitions = false;
} );
}
if ( this.$refs.emptyState ) {
mw.hook( 'search.display' ).fire( this.$refs.emptyState );
}
}
} );
</script>

View file

@ -18,6 +18,9 @@ exports[`App renders a typeahead search component 1`] = `
show-thumbnail="true"
title="search"
>
<div>
empty
</div>
<input
name="title"
type="hidden"