Use refs instead of query the DOM

This commit is contained in:
Filipa Lacerda 2017-04-19 15:30:47 +01:00
parent 6c3038e871
commit 2afff60982
2 changed files with 4 additions and 2 deletions

View file

@ -35,7 +35,7 @@ export default {
onClickAction(endpoint) {
this.isLoading = true;
$(this.$el.querySelector('.has-tooltip')).tooltip('destroy');
$(this.$refs.tooltip).tooltip('destroy');
this.service.postAction(endpoint)
.then(() => {
@ -64,6 +64,7 @@ export default {
class="dropdown btn btn-default dropdown-new js-dropdown-play-icon-container has-tooltip"
data-container="body"
data-toggle="dropdown"
ref="tooltip"
:title="title"
:aria-label="title"
:disabled="isLoading">

View file

@ -28,7 +28,7 @@ export default {
onClickAction(endpoint) {
this.isLoading = true;
$(this.$el.querySelector('.has-tooltip')).tooltip('destroy');
$(this.$refs.tooltip).tooltip('destroy');
this.service.postAction(endpoint)
.then(() => {
@ -59,6 +59,7 @@ export default {
data-toggle="dropdown"
data-placement="top"
aria-label="Manual job"
ref="tooltip"
:disabled="isLoading">
${playIconSvg}
<i