~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/javascript/bugtask_index.js

  • Committer: Graham Binns
  • Date: 2011-09-07 11:26:19 UTC
  • mto: This revision was merged to the branch mainline in revision 13914.
  • Revision ID: graham@canonical.com-20110907112619-ksanxjjowbhnxjhj
The comments form will now be displayed when all comments have finished loading.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1098
1098
namespace.load_more_comments = function(batched_comments_url,
1099
1099
                                        comments_container) {
1100
1100
    var spinner = Y.Node.create(
1101
 
        '<img src="/@@/spinner" style="text_align: center; display: none" />');
 
1101
        '<img src="/@@/spinner" style="text_align: center; ' +
 
1102
        'display: none" />');
1102
1103
    var spinner_span = Y.one('#more-comments-spinner');
1103
1104
    spinner_span.setStyle('display', 'inline');
1104
1105
    var handlers = {
1105
 
        success: function(transactionid, response, arguments) {
 
1106
        success: function(transactionid, response, args) {
1106
1107
            var new_comments_node =
1107
1108
                Y.Node.create("<div></div>");
1108
1109
            new_comments_node.set(
1120
1121
                namespace.load_more_comments(
1121
1122
                    batched_comments_url, comments_container);
1122
1123
            } else {
1123
 
                // Remove the comments-hidden message to avoid
 
1124
                // Remove the comments-hidden messages to avoid
1124
1125
                // confusion.
1125
 
                Y.one('#comments-hidden-message').remove();
 
1126
                Y.each(Y.all('.comments-hidden-message'), function(message) {
 
1127
                    message.remove();
 
1128
                });
 
1129
                // Show the comment form, if available.
 
1130
                var comment_form_container = Y.one(
 
1131
                    '#add-comment-form-container');
 
1132
                if (Y.Lang.isValue(comment_form_container)) {
 
1133
                    comment_form_container.toggleClass('hidden');
 
1134
                }
1126
1135
            }
1127
1136
        }
1128
1137
    };
1152
1161
        });
1153
1162
        show_comments_link.addClass('js-action');
1154
1163
    }
1155
 
}
 
1164
};
1156
1165
 
1157
1166
 
1158
1167
}, "0.1", {"requires": ["base", "oop", "node", "event", "io-base",