Skip to content

Commit

Permalink
MDL-31903 course: Highlight icon will get iniatlised properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajesh Taneja authored and Sam Hemelryk committed Mar 25, 2012
1 parent f753887 commit 618c155
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/ajax/section_classes.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ section_class.prototype.init_buttons = function() {
} }


if (main.getString('courseformat', this.sectionId) != "weeks" && this.sectionId > 0) { 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); YAHOO.util.Event.addListener(highlightbutton, 'click', this.mk_marker, this, true);
commandContainer.appendChild(highlightbutton); commandContainer.appendChild(highlightbutton);
this.highlightButton = highlightbutton; this.highlightButton = highlightbutton;
Expand Down

0 comments on commit 618c155

Please sign in to comment.