Browse Source

Merge pull request #5134 from abpframework/issue/5073

CmsKit: Should focus on the comment area after login and return back
pull/5155/head
Halil İbrahim Kalkan 6 years ago
committed by GitHub
parent
commit
a0f4f4d928
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml
  2. 14
      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

@ -100,7 +100,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>

14
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 {

Loading…
Cancel
Save