Commit d53307125771811d9b3203022a7b672ea2c716f2
1 parent
d8e5cd26
Exists in
staging
and in
7 other branches
before floating form
Showing
1 changed file
with
6 additions
and
19 deletions
Show diff stats
plugins/comment_paragraph/public/comment_paragraph_macro.js
| @@ -68,36 +68,23 @@ jQuery(document).ready(function($) { | @@ -68,36 +68,23 @@ jQuery(document).ready(function($) { | ||
| 68 | } | 68 | } |
| 69 | rootElement.focus(); | 69 | rootElement.focus(); |
| 70 | }); | 70 | }); |
| 71 | - | ||
| 72 | - | ||
| 73 | - | 71 | + |
| 74 | $('#comment-bubble').click(function(){ | 72 | $('#comment-bubble').click(function(){ |
| 75 | this.hide(); | 73 | this.hide(); |
| 76 | $("#comment-bubble").css({top: 0, left: 0, position:'absolute'}); | 74 | $("#comment-bubble").css({top: 0, left: 0, position:'absolute'}); |
| 77 | var url = $("#comment-bubble").data('url'); | 75 | var url = $("#comment-bubble").data('url'); |
| 78 | var paragraphId = $("#comment-bubble").data("paragraphId"); | 76 | var paragraphId = $("#comment-bubble").data("paragraphId"); |
| 79 | console.log(url); | 77 | console.log(url); |
| 80 | - $('.comments_list_toggle_paragraph_0').show(); | 78 | + $('.comments_list_toggle_paragraph_' + paragraphId).show(); |
| 81 | $.ajax({ | 79 | $.ajax({ |
| 82 | dataType: "script", | 80 | dataType: "script", |
| 83 | url: url | 81 | url: url |
| 84 | }).done(function() { | 82 | }).done(function() { |
| 85 | - var button = jQuery('#page-comment-form-' + paragraphId + 'a'); | ||
| 86 | - console.log(button); | 83 | + var button = jQuery('#page-comment-form-' + paragraphId + ' a')[0]; |
| 84 | + //console.log(button); | ||
| 87 | button.click(); | 85 | button.click(); |
| 88 | - $.scrollTo(button); | ||
| 89 | - });; | ||
| 90 | - | ||
| 91 | -// $.getJSON(url, function(data) { | ||
| 92 | -// $('.comments_list_toggle_paragraph_0').show(); | ||
| 93 | -// //var button = $('div.comment_paragraph_'+ data.paragraph_id + ' a'); | ||
| 94 | -// var button = jQuery('#page-comment-form-' + paragraphId + 'a'); | ||
| 95 | -// console.log(button); | ||
| 96 | -// button.click(); | ||
| 97 | -// $.scrollTo(button); | ||
| 98 | -// | ||
| 99 | -// }); | ||
| 100 | - | 86 | + //$('body').scrollTo('#page-comment-form-' + paragraphId + ' a'); |
| 87 | + }); | ||
| 101 | }); | 88 | }); |
| 102 | 89 | ||
| 103 | function processAnchor(){ | 90 | function processAnchor(){ |