diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-04-20 07:22:27 -0600 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-04-20 07:22:27 -0600 |
commit | 5fb615ea51de81f15c8fc61e9018dce74c06ca7a (patch) | |
tree | e032a5c640db192bc65a793ab1d00d827990881d | |
parent | b6b486f013f89a0e0d7a15fc8f2eade31f6764e0 (diff) | |
download | gitlab-ce-9-1-issue-title-on-load.tar.gz |
same fix on stable for issue title poll on load visibility check9-1-issue-title-on-load
-rw-r--r-- | app/assets/javascripts/issue_show/issue_title.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/app/assets/javascripts/issue_show/issue_title.js b/app/assets/javascripts/issue_show/issue_title.js index 1184c8956dc..2d474721270 100644 --- a/app/assets/javascripts/issue_show/issue_title.js +++ b/app/assets/javascripts/issue_show/issue_title.js @@ -33,17 +33,6 @@ export default { }; }, methods: { - fetch() { - this.poll.makeRequest(); - - Visibility.change(() => { - if (!Visibility.hidden()) { - this.poll.restart(); - } else { - this.poll.stop(); - } - }); - }, renderResponse(res) { const body = JSON.parse(res.body); this.triggerAnimation(body); @@ -70,7 +59,17 @@ export default { }, }, created() { - this.fetch(); + if (!Visibility.hidden()) { + this.poll.makeRequest(); + } + + Visibility.change(() => { + if (!Visibility.hidden()) { + this.poll.restart(); + } else { + this.poll.stop(); + } + }); }, template: ` <h2 class='title' v-html='title'></h2> |