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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
1 deletions
-
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/Default.cshtml
-
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js
|
|
|
@ -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> |
|
|
|
|
|
|
|
@ -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 { |
|
|
|
|