From 33251af3ab22f7df9d0f811f9f7c1f1a6577784b Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 27 Dec 2016 21:02:17 -0500 Subject: Defer tooltip update on Resolve Comment button after DOM cycle --- .../javascripts/diff_notes/components/resolve_btn.js.es6 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 b/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 index 88a19fc6e1d..5852b8bbdb7 100644 --- a/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 +++ b/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 @@ -59,9 +59,11 @@ }, methods: { updateTooltip: function () { - $(this.$refs.button) - .tooltip('hide') - .tooltip('fixTitle'); + this.$nextTick(() => { + $(this.$refs.button) + .tooltip('hide') + .tooltip('fixTitle'); + }); }, resolve: function () { if (!this.canResolve) return; @@ -90,7 +92,7 @@ new Flash('An error occurred when trying to resolve a comment. Please try again.', 'alert'); } - this.$nextTick(this.updateTooltip); + this.updateTooltip(); }); } }, -- cgit v1.2.1