Browse Source

CmsKit: Should focus on the comment area after login and return back

https://github.com/abpframework/abp/issues/5073
pull/5134/head
Yunus Emre Kalkan 6 years ago
parent
commit
a3744f812e
  1. 2
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml
  2. 10
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js

2
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml

@ -87,7 +87,7 @@
</div>;
}
<div class="cms-comment-area" data-entity-type="@Model.EntityType" data-entity-id="@Model.EntityId">
<div class="cms-comment-area" data-entity-type="@Model.EntityType" data-entity-id="@Model.EntityId" id="@($"cms-comment_{Model.EntityType}_{Model.EntityId}")">
<div class="pl-5 pt-3">
<h4>

10
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js

@ -135,6 +135,14 @@
});
}
function focusOnHash($container) {
if (location.hash === ''){
return;
}
$('html, body').animate({ scrollTop: $(location.hash).offset().top + $(this).height() / 2 }, 'slow');
}
function init() {
registerReplyLinks($widget);
registerEditLinks($widget);
@ -142,6 +150,8 @@
registerUpdateOfNewComment($widget);
registerSubmissionOfNewComment($widget);
focusOnHash($widget);
}
return {

Loading…
Cancel
Save