diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml index 235902cdd4..c9fee7e7d8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml @@ -100,7 +100,7 @@ ; } -
+

diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js index 8e48446a83..764a5f74eb 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js @@ -135,6 +135,18 @@ }); } + function focusOnHash($container) { + if (!location.hash.toLowerCase().startsWith('#cms-comment')){ + return; + } + + $('html, body').animate( + { + scrollTop: $(location.hash).offset().top + $(this).height() / 2 + }, + 'slow'); + } + function init() { registerReplyLinks($widget); registerEditLinks($widget); @@ -142,6 +154,8 @@ registerUpdateOfNewComment($widget); registerSubmissionOfNewComment($widget); + + focusOnHash($widget); } return {