From 0cdaaf801916e4cb0f32bef7ab542ced9c1a19f6 Mon Sep 17 00:00:00 2001 From: Xiaoxi Date: Tue, 21 Jan 2020 00:26:50 -0500 Subject: [PATCH] fix issue #117 progress indicator stuck problem --- .gitignore | 1 + src/js/post.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 711eeb5..da6d7ce 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ npm-debug.log node_modules .DS_Store +.idea \ No newline at end of file diff --git a/src/js/post.js b/src/js/post.js index fd07da7..2595301 100644 --- a/src/js/post.js +++ b/src/js/post.js @@ -69,9 +69,11 @@ function setHeights() { } function setCircleStyles() { - const radiusCircle = $progressCircle.parent().width() / 2 + const svgWidth = $progressCircle.parent().width(); + const radiusCircle = svgWidth / 2 const borderWidth = isMobile() ? 2 : 3 + $progressCircle.parent().attr('viewBox', `0 0 ${svgWidth} ${svgWidth}`) $progressCircle.attr('stroke-width', borderWidth) $progressCircle.attr('r', radiusCircle - (borderWidth - 1)) $progressCircle.attr('cx', radiusCircle)