From 690cf46b0cdf0ea0e152caaf3e316113ff673b9c Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Thu, 15 Mar 2012 15:19:36 +0800 Subject: [PATCH] MDL-31903 course: update patch to fix course highlight icon and title toggle --- lib/ajax/ajaxcourse.js | 1 + lib/ajax/section_classes.js | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/ajax/ajaxcourse.js b/lib/ajax/ajaxcourse.js index 15f3bdbd29d..f130e86b486 100644 --- a/lib/ajax/ajaxcourse.js +++ b/lib/ajax/ajaxcourse.js @@ -198,6 +198,7 @@ main_class.prototype.mk_button = function(tag, imgSrc, text, attributes, imgAttr image.setAttribute(imgAttributes[c][0], imgAttributes[c][1]); } } + image.setAttribute('hspace', '3'); return container; }; diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index 64eb73dca1e..c1fecadfe6a 100644 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -92,15 +92,14 @@ section_class.prototype.init_buttons = function() { } if (main.getString('courseformat', this.sectionId) != "weeks" && this.sectionId > 0) { - var highlightbutton = main.mk_button('div', main.portal.icons['marker'], main.getString('marker', this.sectionId), - [['class', 'button highlightbutton']], [['class', 'highlightimage']]); + var highlightbutton = main.mk_button('div', main.portal.icons['marker'], main.getString('marker', this.sectionId)); YAHOO.util.Event.addListener(highlightbutton, 'click', this.mk_marker, this, true); commandContainer.appendChild(highlightbutton); this.highlightButton = highlightbutton; } if (this.sectionId > 0) { var viewbutton = main.mk_button('div', main.portal.icons['hide'], main.getString('hidesection', this.sectionId), - [['title', main.portal.strings['hide']],['class', 'button hidebutton']], [['class', 'hideimage']]); + [['title', main.portal.strings['hide'] ]]); YAHOO.util.Event.addListener(viewbutton, 'click', this.toggle_hide, this,true); commandContainer.appendChild(viewbutton); this.viewButton = viewbutton; @@ -364,15 +363,22 @@ section_class.prototype.toggle_hide = function(e,target,superficial) { section_class.prototype.toggle_highlight = function() { + var strmarker = main.portal.strings['marker']; + var strmarked = main.portal.strings['marked']; + if (this.highlighted) { YAHOO.util.Dom.removeClass(this.getEl(), 'current'); this.highlightButton.childNodes[0].src = main.portal.icons['marker']; - this.highlightButton.title = main.getString('marker', this.sectionId); + this.highlightButton.childNodes[0].alt = strmarker; + this.highlightButton.childNodes[0].title = strmarker; //for IE + this.highlightButton.title = strmarker; this.highlighted = false; } else { YAHOO.util.Dom.addClass(this.getEl(), 'current'); this.highlightButton.childNodes[0].src = main.portal.icons['marked']; - this.highlightButton.title = main.getString('marked', this.sectionId); + this.highlightButton.childNodes[0].alt = strmarked; + this.highlightButton.childNodes[0].title = strmarked; //for IE + this.highlightButton.title = strmarked; this.highlighted = true; } };