MDL-31903 course: update patch to fix course highlight icon and title toggle

This commit is contained in:
Rajesh Taneja
2012-03-26 11:46:13 +13:00
committed by Sam Hemelryk
parent c62eeedab7
commit 690cf46b0c
2 changed files with 12 additions and 5 deletions
+1
View File
@@ -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;
};
+11 -5
View File
@@ -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;
}
};