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

This commit is contained in:
Dan Poltawski 2017-01-30 09:54:13 +00:00
commit b040b52340
2 changed files with 16 additions and 1 deletions

View File

@ -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]);

View File

@ -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');