MDL-58235 block_myoverview: fix buttons on courses view
authorRyan Wyllie <ryan@moodle.com>
Tue, 11 Apr 2017 00:20:29 +0000 (00:20 +0000)
committerRyan Wyllie <ryan@moodle.com>
Tue, 11 Apr 2017 00:20:29 +0000 (00:20 +0000)
theme/bootstrapbase/templates/block_myoverview/courses-view.mustache

index b8a9dee..45a38d5 100644 (file)
 require(['jquery', 'core/custom_interaction_events'], function($, customEvents) {
     var root = $('#courses-view-{{uniqid}}');
     customEvents.define(root, [customEvents.events.activate]);
-    root.on(customEvents.events.activate, '[data-toggle="btns"] > .btn', function() {
+    root.on(customEvents.events.activate, '[data-toggle="btns"] > .btn', function(e) {
         root.find('.btn.active').removeClass('active');
+        $(e.target).closest('.btn').addClass('active');
     });
 });
 {{/js}}