MDL-31903 course: Highlight icon will get iniatlised properly

This commit is contained in:
Rajesh Taneja
2012-03-26 11:46:13 +13:00
committed by Sam Hemelryk
parent 690cf46b0c
commit 65df3cd2cb
+7 -1
View File
@@ -92,7 +92,13 @@ 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));
var highlightbutton = '';
//If current topic, then initalised as marked else marker
if (YAHOO.util.Dom.hasClass(this.getEl(),'current')) {
highlightbutton = main.mk_button('div', main.portal.icons['marked'], main.getString('marked', this.sectionId));
} else {
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;