summaryrefslogtreecommitdiffstats
path: root/hyperkitty/static
diff options
context:
space:
mode:
Diffstat (limited to 'hyperkitty/static')
-rw-r--r--hyperkitty/static/hyperkitty/js/hyperkitty-common.js9
-rw-r--r--hyperkitty/static/hyperkitty/js/hyperkitty-thread.js6
2 files changed, 12 insertions, 3 deletions
diff --git a/hyperkitty/static/hyperkitty/js/hyperkitty-common.js b/hyperkitty/static/hyperkitty/js/hyperkitty-common.js
index b9fc897..1fb1eb3 100644
--- a/hyperkitty/static/hyperkitty/js/hyperkitty-common.js
+++ b/hyperkitty/static/hyperkitty/js/hyperkitty-common.js
@@ -77,7 +77,10 @@ function setup_vote(baseElem) {
* New messages (or replies)
*/
-function setup_attachments() {
+function setup_attachments(baseElem) {
+ if (!baseElem) {
+ baseElem = document;
+ }
function add_attach_form (e) {
e.preventDefault();
var form = $(this).parents("form").first();
@@ -95,8 +98,8 @@ function setup_attachments() {
form.find(".attach-files-first").hide();
form.find(".attach-files-add").show();
}
- $(".attach-files-add").click(add_attach_form);
- $(".attach-files-first").click(add_attach_form);
+ $(baseElem).find(".attach-files-add").click(add_attach_form);
+ $(baseElem).find(".attach-files-first").click(add_attach_form);
}
diff --git a/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js b/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
index e6c726f..c7b69a5 100644
--- a/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
+++ b/hyperkitty/static/hyperkitty/js/hyperkitty-thread.js
@@ -145,6 +145,7 @@ function setup_favorites() {
}
+
/*
* Replies
*/
@@ -297,9 +298,13 @@ function setup_unreadnavbar(element) {
}
+
/*
* Thread replies list
+ * Updates the list of replies in a thread chunk-by-chunk to avoid blocking the
+ * UI
*/
+
function update_thread_replies(url) {
function load_more(current_url) {
$.ajax({
@@ -315,6 +320,7 @@ function update_thread_replies(url) {
fold_quotes(newcontent);
setup_disabled_tooltips(newcontent);
setup_vote(newcontent);
+ setup_attachments(newcontent);
// load the rest if applicable
if (data.more_pending) {
load_more(url+"&offset="+data.next_offset);