Browse files

Merge branch 'WIP-MDL-35481' of git://github.com/nadavkav/moodle

  • Loading branch information...
2 parents 21ba954 + 9fe40de commit ba6d56c202ad55c6eb1600203540fb6c1d631789 @stronk7 stronk7 committed Sep 27, 2012
Showing with 37 additions and 6 deletions.
  1. +7 −1 comment/comment.js
  2. +7 −1 comment/lib.php
  3. +9 −2 enrol/manual/yui/quickenrolment/quickenrolment.js
  4. +14 −2 lib/javascript-static.js
View
8 comment/comment.js
@@ -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','');
}
View
8 comment/lib.php
@@ -429,8 +429,14 @@ public function output($return = true) {
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');
}
View
11 enrol/manual/yui/quickenrolment/quickenrolment.js
@@ -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'));
}
View
16 lib/javascript-static.js
@@ -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'));
}

0 comments on commit ba6d56c

Please sign in to comment.