Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-37074 Assign theming: Use addClass/removeClass instead of setAttr…

…ibute to preserve existing classes
  • Loading branch information...
commit 1d16b7f80cdd9d2fcab6355d7c12eb183ee1e859 1 parent 0e6d8bc
@damyon damyon authored
Showing with 12 additions and 6 deletions.
  1. +12 −6 mod/assign/module.js
View
18 mod/assign/module.js
@@ -24,17 +24,21 @@ M.mod_assign.init_grading_table = function(Y) {
node.on('change', function(e) {
rowelement = e.currentTarget.get('parentNode').get('parentNode');
if (e.currentTarget.get('checked')) {
- rowelement.setAttribute('class', 'selectedrow');
+ rowelement.removeClass('unselectedrow');
+ rowelement.addClass('selectedrow');
} else {
- rowelement.setAttribute('class', 'unselectedrow');
+ rowelement.removeClass('selectedrow');
+ rowelement.addClass('unselectedrow');
}
});
rowelement = node.get('parentNode').get('parentNode');
if (node.get('checked')) {
- rowelement.setAttribute('class', 'selectedrow');
+ rowelement.removeClass('unselectedrow');
+ rowelement.addClass('selectedrow');
} else {
- rowelement.setAttribute('class', 'unselectedrow');
+ rowelement.removeClass('selectedrow');
+ rowelement.addClass('unselectedrow');
}
});
@@ -46,14 +50,16 @@ M.mod_assign.init_grading_table = function(Y) {
checkboxes.each(function(node) {
rowelement = node.get('parentNode').get('parentNode');
node.set('checked', true);
- rowelement.setAttribute('class', 'selectedrow');
+ rowelement.removeClass('unselectedrow');
+ rowelement.addClass('selectedrow');
});
} else {
checkboxes = Y.all('td.c0 input');
checkboxes.each(function(node) {
rowelement = node.get('parentNode').get('parentNode');
node.set('checked', false);
- rowelement.setAttribute('class', 'unselectedrow');
+ rowelement.removeClass('selectedrow');
+ rowelement.addClass('unselectedrow');
});
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.