MDL-33186 Ensure that the comment textarea exists before toggling it
authorAndrew Robert Nicols <andrew.nicols@luns.net.uk>
Tue, 22 May 2012 10:24:24 +0000 (11:24 +0100)
committerAndrew Robert Nicols <andrew.nicols@luns.net.uk>
Tue, 22 May 2012 10:24:24 +0000 (11:24 +0100)
comment/comment.js

index dcf669e..a16b83a 100644 (file)
@@ -385,6 +385,9 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
             },
             toggle_textarea: function(focus) {
                 var t = Y.one('#dlg-content-'+this.client_id);
+                if (!t) {
+                    return false;
+                }
                 if (focus) {
                     if (t.get('value') == M.str.moodle.addcomment) {
                         t.set('value', '');