Permalink
Browse files

MDL-31903 course: Highlight icon will get iniatlised properly

  • Loading branch information...
1 parent 690cf46 commit 65df3cd2cb0a8d847f910da16824f039aa79b093 @rajeshtaneja rajeshtaneja committed with Sam Hemelryk Mar 16, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/ajax/section_classes.js
View
8 lib/ajax/section_classes.js
@@ -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;

0 comments on commit 65df3cd

Please sign in to comment.