Add additional frontend hooks (#2073)

This commit is contained in:
Ahsan Virani 2021-08-13 12:01:12 +02:00 committed by GitHub
parent 309324f60f
commit 31cf43c294
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -18,9 +18,12 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from "vue";
export default Vue.extend({ import mixins from 'vue-typed-mixins';
import { externalHooks } from '@/components/mixins/externalHooks';
export default mixins(externalHooks).extend({
name: "SearchBar", name: "SearchBar",
props: ["value", "eventBus"], props: ["value", "eventBus"],
mounted() { mounted() {
@ -32,6 +35,8 @@ export default Vue.extend({
setTimeout(() => { setTimeout(() => {
this.focus(); this.focus();
}, 0); }, 0);
this.$externalHooks().run('nodeCreator_searchBar.mount', { inputRef: this.$refs['input'] });
}, },
methods: { methods: {
focus() { focus() {

View file

@ -134,6 +134,7 @@ import ExpressionEdit from '@/components/ExpressionEdit.vue';
// @ts-ignore // @ts-ignore
import PrismEditor from 'vue-prism-editor'; import PrismEditor from 'vue-prism-editor';
import TextEdit from '@/components/TextEdit.vue'; import TextEdit from '@/components/TextEdit.vue';
import { externalHooks } from '@/components/mixins/externalHooks';
import { genericHelpers } from '@/components/mixins/genericHelpers'; import { genericHelpers } from '@/components/mixins/genericHelpers';
import { nodeHelpers } from '@/components/mixins/nodeHelpers'; import { nodeHelpers } from '@/components/mixins/nodeHelpers';
import { showMessage } from '@/components/mixins/showMessage'; import { showMessage } from '@/components/mixins/showMessage';
@ -142,6 +143,7 @@ import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import mixins from 'vue-typed-mixins'; import mixins from 'vue-typed-mixins';
export default mixins( export default mixins(
externalHooks,
genericHelpers, genericHelpers,
nodeHelpers, nodeHelpers,
showMessage, showMessage,
@ -621,6 +623,8 @@ export default mixins(
} }
} }
} }
this.$externalHooks().run('parameterInput.mount', { parameter: this.parameter, inputFieldRef: this.$refs['inputField'] });
}, },
}); });
</script> </script>