MDL-61127 filepicker: Selected repository now highlighted.
authorAdrian Greeve <adrian@moodle.com>
Tue, 9 Jan 2018 03:58:07 +0000 (11:58 +0800)
committerAdrian Greeve <adrian@moodle.com>
Tue, 3 Apr 2018 08:25:41 +0000 (16:25 +0800)
repository/filepicker.js

index bd3a83a..102f052 100644 (file)
@@ -1643,10 +1643,15 @@ M.core_filepicker.init = function(Y, options) {
                     .removeClass('active')
                     .setAttribute('aria-selected', 'false')
                     .setAttribute('tabindex', '-1');
-            scope.fpnode.all('#fp-repo-'+scope.options.client_id+'-'+obj.repo_id)
-                    .addClass('active')
+            scope.fpnode.all('.nav-link')
+                    .removeClass('active')
+                    .setAttribute('aria-selected', 'false')
+                    .setAttribute('tabindex', '-1');
+            var activenode = scope.fpnode.one('#fp-repo-' + scope.options.client_id + '-' + obj.repo_id);
+            activenode.addClass('active')
                     .setAttribute('aria-selected', 'true')
                     .setAttribute('tabindex', '0');
+            activenode.all('.nav-link').addClass('active');
             // add class repository_REPTYPE to the filepicker (for repository-specific styles)
             for (var i in scope.options.repositories) {
                 scope.fpnode.removeClass('repository_'+scope.options.repositories[i].type)