aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--view/js/main.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/view/js/main.js b/view/js/main.js
index bc1c48cf1..2b4acdf61 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1140,15 +1140,17 @@ function doprofilelike(ident, verb) {
$.get('like/' + ident + '?verb=' + verb, function() { window.location.href=window.location.href; });
}
+
function doreply(parent, ident, owner, hint) {
- var form = $('#comment-edit-form-' + parent.toString());
- form.find('input[name=parent]').val(ident);
- var i = form.find('button[type=submit]');
- var btn = i.html().replace(/<[^>]*>/g, '').trim();
- i.html('<i class="fa fa-reply" ></i> ' + btn);
- var sel = 'wall-item-body-' + ident.toString();
- form.find('textarea').val("@{" + owner + "}" + (($(window.getSelection().anchorNode).closest("#" + sel).attr("id") != sel) ? " " : "\n[quote]" + window.getSelection().toString() + "[/quote]\n"));
- $('#comment-edit-text-' + parent.toString()).focus();
+ var form = $('#comment-edit-form-' + parent.toString());
+ form.find('input[name=parent]').val(ident);
+ var i = form.find('button[type=submit]');
+ var btn = i.html().replace(/<[^>]*>/g, '').trim();
+ i.html('<i class="fa fa-reply" ></i> ' + btn);
+ var sel = 'wall-item-body-' + ident.toString();
+ var quote = window.getSelection().toString().trim();
+ form.find('textarea').val("@{" + owner + "}" + ((($(window.getSelection().anchorNode).closest("#" + sel).attr("id") != sel) || (quote.length === 0))? " " : "\n[quote]" + quote + "[/quote]\n"));
+ $('#comment-edit-text-' + parent.toString()).focus();
}
function doscroll(parent, hidden) {