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 { ...@@ -90,7 +90,6 @@ export default {
}, },
handleQuote() { handleQuote() {
const documentFragment = getSelectedFragment(); const documentFragment = getSelectedFragment();
const area = this.$parent.$slots.textarea[0].elm;
if (!documentFragment || !documentFragment.textContent) { if (!documentFragment || !documentFragment.textContent) {
this.tag = '> '; this.tag = '> ';
...@@ -99,6 +98,7 @@ export default { ...@@ -99,6 +98,7 @@ export default {
this.tag = ''; this.tag = '';
const transformed = CopyAsGFM.transformGFMSelection(documentFragment); const transformed = CopyAsGFM.transformGFMSelection(documentFragment);
const area = this.$el.parentNode.querySelector('textarea');
CopyAsGFM.nodeToGFM(transformed) CopyAsGFM.nodeToGFM(transformed)
.then(gfm => { .then(gfm => {
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
:tag="tag" :tag="tag"
:button-title="__('Insert a quote')" :button-title="__('Insert a quote')"
icon="quote" icon="quote"
@update-tag="handleQuote" @click="handleQuote"
/> />
</div> </div>
<div class="d-inline-block ml-md-2 ml-0"> <div class="d-inline-block ml-md-2 ml-0">
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
type="button" type="button"
class="toolbar-btn js-md" class="toolbar-btn js-md"
data-container="body" data-container="body"
@click="$emit('update-tag'), () => $emit('click')" @click="() => $emit('click')"
> >
<icon :name="icon" /> <icon :name="icon" />
</button> </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