From 5fb615ea51de81f15c8fc61e9018dce74c06ca7a Mon Sep 17 00:00:00 2001 From: Regis Date: Thu, 20 Apr 2017 07:22:27 -0600 Subject: same fix on stable for issue title poll on load visibility check --- app/assets/javascripts/issue_show/issue_title.js | 23 +++++++++++------------ 1 file 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: `

-- cgit v1.2.1