From bb80768558a4ddd755305e7b8b7925fef9d2771d Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 31 Jan 2017 11:24:13 +0800 Subject: [PATCH] MDL-35978 comments: fix for comments block which has no toggler --- comment/comment.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/comment/comment.js b/comment/comment.js index 5cc0fae6542..bdcc7bc9236 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -358,7 +358,9 @@ M.core_comment = { if (img) { img.set('src', M.util.image_url('t/expanded', 'core')); } - commenttoggler.setAttribute('aria-expanded', 'true'); + if (commenttoggler) { + commenttoggler.setAttribute('aria-expanded', 'true'); + } } else { // hide container.setStyle('display', 'none'); @@ -372,7 +374,9 @@ M.core_comment = { if (ta) { ta.set('value',''); } - commenttoggler.setAttribute('aria-expanded', 'false'); + if (commenttoggler) { + commenttoggler.setAttribute('aria-expanded', 'false'); + } } if (ta) { //toggle_textarea.apply(ta, [false]);