Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/VincentTam/huginn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorVincent Tam <sere@live.hk>2019-05-20 14:46:29 +0300
committerVincent Tam <sere@live.hk>2019-05-20 14:46:29 +0300
commitc446cb28ae1a40899acfaa92abdca47ec87573a0 (patch)
treeaefce01eee885c64a71e6a7e29312634388d6b96 /static
parentbb5dc77c22d6bfcab5ec98e27a41cc19d3b06263 (diff)
Template pour Staticman simplifié
Diffstat (limited to 'static')
-rw-r--r--static/js/staticman.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/static/js/staticman.js b/static/js/staticman.js
index 81800ee..40c0c09 100644
--- a/static/js/staticman.js
+++ b/static/js/staticman.js
@@ -46,10 +46,11 @@ $(document).ready(function() {
}
// record reply target when "reply to this comment" is pressed
- $('.comment-reply-btn a').click(function (){
+ $('article.static-comment').on("click", "a.btn", function (evt){
+ var cmt = $(evt.delegateTarget);
$('input[name="fields[replyThread]"]').val(this.title);
- $('input[name="fields[replyID]"]').val(this.id);
- authorTag = $(this).parents('.static-comment').children('h4.comment-author');
+ $('input[name="fields[replyID]"]').val(cmt.attr("id"));
+ authorTag = cmt.children('h4.comment-author');
$('input[name="fields[replyName]"]').val(authorTag.text());
$('.js-form fieldset button.button').text('Submit reply');
});
@@ -58,11 +59,4 @@ $(document).ready(function() {
$('.js-form fieldset button[type="reset"]').click(function (){
clearForm();
});
-
- // smooth scroll to reply target
- $('.comment-reply-target a[href^="#"]').click(function (){
- targetPostID = $(this).attr('href');
- targetID = "#" + $(targetPostID).parents('.static-comment').attr('id');
- $('html, body').animate({ scrollTop: $(targetID).offset().top-$('nav').height() }, 500);
- });
});