Commit d920ae02 authored by Jochen Roth's avatar Jochen Roth

Remove `update-tag` event and use existing click event, do not access vuejs...

Remove `update-tag` event and use existing click event, do not access vuejs elements directyl instead use `querySelector`

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36753#note_383620360
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36753#note_383620356
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36753#note_383620351
parent ed0423c7
......@@ -90,7 +90,6 @@ export default {
},
handleQuote() {
const documentFragment = getSelectedFragment();
const area = this.$parent.$slots.textarea[0].elm;
if (!documentFragment || !documentFragment.textContent) {
this.tag = '> ';
......@@ -99,6 +98,7 @@ export default {
this.tag = '';
const transformed = CopyAsGFM.transformGFMSelection(documentFragment);
const area = this.$el.parentNode.querySelector('textarea');
CopyAsGFM.nodeToGFM(transformed)
.then(gfm => {
......@@ -136,7 +136,7 @@ export default {
:tag="tag"
:button-title="__('Insert a quote')"
icon="quote"
@update-tag="handleQuote"
@click="handleQuote"
/>
</div>
<div class="d-inline-block ml-md-2 ml-0">
......
......@@ -65,7 +65,7 @@ export default {
type="button"
class="toolbar-btn js-md"
data-container="body"
@click="$emit('update-tag'), () => $emit('click')"
@click="() => $emit('click')"
>
<icon :name="icon" />
</button>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment