summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-04-19 15:30:47 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-04-19 15:30:47 +0100
commit2afff60982e9ccc4afa80951acda8e754ffde6fe (patch)
treeeb007f38cf1e194717ee1f09677fc8eabfc15f3f /app/assets
parent6c3038e8714a2e9b959cf09cd0658b48118d2ddf (diff)
downloadgitlab-ce-2afff60982e9ccc4afa80951acda8e754ffde6fe.tar.gz
Use refs instead of query the DOM
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/environments/components/environment_actions.js3
-rw-r--r--app/assets/javascripts/pipelines/components/pipelines_actions.js3
2 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/environments/components/environment_actions.js b/app/assets/javascripts/environments/components/environment_actions.js
index 1f325d66e87..313e78e573a 100644
--- a/app/assets/javascripts/environments/components/environment_actions.js
+++ b/app/assets/javascripts/environments/components/environment_actions.js
@@ -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">
diff --git a/app/assets/javascripts/pipelines/components/pipelines_actions.js b/app/assets/javascripts/pipelines/components/pipelines_actions.js
index 535064f610e..ffda18d2e0f 100644
--- a/app/assets/javascripts/pipelines/components/pipelines_actions.js
+++ b/app/assets/javascripts/pipelines/components/pipelines_actions.js
@@ -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