Commit b040b523 authored by Dan Poltawski's avatar Dan Poltawski
Browse files

Merge branch 'MDL-35978-master' of https://github.com/snake/moodle

parents 9e3df32f af65270e
......@@ -57,6 +57,12 @@ M.core_comment = {
this.view(0);
return false;
}, this);
// Also handle space/enter key.
handle.on('key', function(e) {
e.preventDefault();
this.view(0);
return false;
}, '13,32', this);
}
scope.toggle_textarea(false);
},
......@@ -335,6 +341,7 @@ M.core_comment = {
);
},
view: function(page) {
var commenttoggler = Y.one('#comment-link-' + this.client_id);
var container = Y.one('#comment-ctrl-'+this.client_id);
var ta = Y.one('#dlg-content-'+this.client_id);
var img = Y.one('#comment-img-'+this.client_id);
......@@ -351,6 +358,7 @@ M.core_comment = {
if (img) {
img.set('src', M.util.image_url('t/expanded', 'core'));
}
commenttoggler.setAttribute('aria-expanded', 'true');
} else {
// hide
container.setStyle('display', 'none');
......@@ -364,6 +372,7 @@ M.core_comment = {
if (ta) {
ta.set('value','');
}
commenttoggler.setAttribute('aria-expanded', 'false');
}
if (ta) {
//toggle_textarea.apply(ta, [false]);
......
......@@ -460,7 +460,13 @@ class comment {
} else {
$collapsedimage= 't/collapsed';
}
$html .= html_writer::start_tag('a', array('class' => 'comment-link', 'id' => 'comment-link-'.$this->cid, 'href' => '#'));
$html .= html_writer::start_tag('a', array(
'class' => 'comment-link',
'id' => 'comment-link-'.$this->cid,
'href' => '#',
'role' => 'button',
'aria-expanded' => 'false')
);
$html .= html_writer::empty_tag('img', array('id' => 'comment-img-'.$this->cid, 'src' => $OUTPUT->pix_url($collapsedimage), 'alt' => $this->linktext, 'title' => $this->linktext));
$html .= html_writer::tag('span', $this->linktext.' '.$countstring, array('id' => 'comment-link-text-'.$this->cid));
$html .= html_writer::end_tag('a');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment