mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'WIP-MDL-35481' of git://github.com/nadavkav/moodle
This commit is contained in:
commit
ba6d56c202
@ -361,7 +361,13 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
|
||||
} else {
|
||||
// hide
|
||||
container.setStyle('display', 'none');
|
||||
img.set('src', M.util.image_url('t/collapsed', 'core'));
|
||||
var collapsedimage = 't/collapsed'; // ltr mode
|
||||
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
||||
collapsedimage = 't/collapsed_rtl';
|
||||
} else {
|
||||
collapsedimage = 't/collapsed';
|
||||
}
|
||||
img.set('src', M.util.image_url(collapsedimage, 'core'));
|
||||
if (ta) {
|
||||
ta.set('value','');
|
||||
}
|
||||
|
@ -429,8 +429,14 @@ class comment {
|
||||
if ($this->displaytotalcount) {
|
||||
$countstring = '('.$this->count().')';
|
||||
}
|
||||
$collapsedimage= 't/collapsed';
|
||||
if (right_to_left()) {
|
||||
$collapsedimage= 't/collapsed_rtl';
|
||||
} else {
|
||||
$collapsedimage= 't/collapsed';
|
||||
}
|
||||
$html .= html_writer::start_tag('a', array('class' => 'comment-link', 'id' => 'comment-link-'.$this->cid, 'href' => '#'));
|
||||
$html .= html_writer::empty_tag('img', array('id' => 'comment-img-'.$this->cid, 'src' => $OUTPUT->pix_url('t/collapsed'), 'alt' => $this->linktext, 'title' => $this->linktext));
|
||||
$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');
|
||||
}
|
||||
|
@ -141,12 +141,19 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
base.dd.addHandle('.'+CSS.HEADER+' h2');
|
||||
base.one('.'+CSS.HEADER+' h2').setStyle('cursor', 'move');
|
||||
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/collapsed', 'moodle'));
|
||||
var collapsedimage = 't/collapsed'; // ltr mode
|
||||
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
||||
collapsedimage = 't/collapsed_rtl';
|
||||
} else {
|
||||
collapsedimage = 't/collapsed';
|
||||
}
|
||||
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url(collapsedimage, 'moodle'));
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).on('click', function(){
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).toggleClass(CSS.ACTIVE);
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEAREA).toggleClass(CSS.HIDDEN);
|
||||
if (this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEAREA).hasClass(CSS.HIDDEN)) {
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/collapsed', 'moodle'));
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url(collapsedimage, 'moodle'));
|
||||
} else {
|
||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/expanded', 'moodle'));
|
||||
}
|
||||
|
@ -103,9 +103,15 @@ M.util.CollapsibleRegion = function(Y, id, userpref, strtooltip) {
|
||||
|
||||
// Get the height of the div at this point before we shrink it if required
|
||||
var height = this.div.get('offsetHeight');
|
||||
var collapsedimage = 't/collapsed'; // ltr mode
|
||||
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
||||
collapsedimage = 't/collapsed_rtl';
|
||||
} else {
|
||||
collapsedimage = 't/collapsed';
|
||||
}
|
||||
if (this.div.hasClass('collapsed')) {
|
||||
// Add the correct image and record the YUI node created in the process
|
||||
this.icon = Y.Node.create('<img src="'+M.util.image_url('t/collapsed', 'moodle')+'" alt="" />');
|
||||
this.icon = Y.Node.create('<img src="'+M.util.image_url(collapsedimage, 'moodle')+'" alt="" />');
|
||||
// Shrink the div as it is collapsed by default
|
||||
this.div.setStyle('height', caption.get('offsetHeight')+'px');
|
||||
} else {
|
||||
@ -126,8 +132,14 @@ M.util.CollapsibleRegion = function(Y, id, userpref, strtooltip) {
|
||||
// Handler for the animation finishing.
|
||||
animation.on('end', function() {
|
||||
this.div.toggleClass('collapsed');
|
||||
var collapsedimage = 't/collapsed'; // ltr mode
|
||||
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
||||
collapsedimage = 't/collapsed_rtl';
|
||||
} else {
|
||||
collapsedimage = 't/collapsed';
|
||||
}
|
||||
if (this.div.hasClass('collapsed')) {
|
||||
this.icon.set('src', M.util.image_url('t/collapsed', 'moodle'));
|
||||
this.icon.set('src', M.util.image_url(collapsedimage, 'moodle'));
|
||||
} else {
|
||||
this.icon.set('src', M.util.image_url('t/expanded', 'moodle'));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user