Merge pull request #228 from benwrighton/master

This commit is contained in:
Daniel Hensby 2018-02-02 10:45:48 +00:00
commit b90ec7715e
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
2 changed files with 19 additions and 12 deletions

View File

@ -79,20 +79,25 @@
* Toggle on/off reply form * Toggle on/off reply form
*/ */
$( ".comment-reply-link" ).entwine({ $( ".comment-reply-link" ).entwine({
onclick: function( e ) { onclick: function( e ) {
var allForms = $( ".comment-reply-form-holder" ), var allForms = $( ".comment-reply-form-holder" ),
formID = $( this ).prop('href').replace(/^[^#]*#/, '#'), formID = '#' + $( this ).attr('aria-controls');
form = $(formID).closest('.comment-reply-form-holder'); form = $(formID).closest('.comment-reply-form-holder');
// Prevent focus $(this).attr('aria-expanded', function (i, attr) {
e.preventDefault(); return attr == 'true' ? 'false' : 'true'
if(form.is(':visible')) { });
allForms.slideUp();
} else { // Prevent focus
allForms.not(form).slideUp(); e.preventDefault();
if(form.is(':visible')) {
allForms.slideUp();
} else {
allForms.not(form).slideUp();
form.slideDown(); form.slideDown();
} }
} }
}); });

View File

@ -33,7 +33,9 @@
<% end_if %> <% end_if %>
</div> </div>
<% if $RepliesEnabled && $canPostComment %> <% if $RepliesEnabled && $canPostComment %>
<a class="comment-reply-link" href="#{$ReplyForm.FormName}"><% _t('CommentsInterface_singlecomment_ss.REPLYTO','Reply to') %> $AuthorName.XML</a> <button class="comment-reply-link" type="button" aria-controls="$ReplyForm.FormName" aria-expanded="false">
<% _t('CommentsInterface_singlecomment_ss.REPLYTO','Reply to') %> $AuthorName.XML
</button>
<% end_if %> <% end_if %>
</div> </div>
<% end_if %> <% end_if %>