Skip to content

Commit e29f0f0

Browse files
author
Ilya Radchenko
committed
Fix config nav plugin order
Previously the plugins in the config left nav were ordered randomly and did not line up to the order in the plugins page. This change makes the rendering happen in angular instead of swig, this fixing the order.
1 parent 632cc99 commit e29f0f0

File tree

6 files changed

+20
-23
lines changed

6 files changed

+20
-23
lines changed

client/config/controllers/config.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function ConfigController($scope, $element, $sce) {
2727
$scope.disabled_plugins = {};
2828
$scope.configs = {};
2929
$scope.runnerConfigs = {};
30-
$scope.api_root = '/' + $scope.project.name + '/api/';
30+
$scope.api_root = `/${$scope.project.name}/api/`;
3131
$scope.page = 'config';
3232

3333
$(function ConfigPageRouting() {
@@ -52,7 +52,7 @@ function ConfigController($scope, $element, $sce) {
5252

5353
// support the back button
5454
global.onpopstate = function () {
55-
self.route();
55+
self.route();
5656
};
5757

5858
this.route();
@@ -73,8 +73,7 @@ function ConfigController($scope, $element, $sce) {
7373

7474
if (branchName) {
7575
switchToBranch(branchName);
76-
}
77-
else {
76+
} else {
7877
global.sessionStorage.removeItem('branchName');
7978
}
8079

@@ -116,9 +115,9 @@ function ConfigController($scope, $element, $sce) {
116115
tab = branch && branch.name === 'master' ? 'tab-project' : 'tab-basic';
117116
}
118117

119-
$('#' + tab + '-tab-handle').tab('show');
118+
$(`#${tab}-tab-handle`).tab('show');
120119
selectTab(tab);
121-
$('a[href=#' + tab + ']').tab('show');
120+
$(`a[href=#${tab}]`).tab('show');
122121
}
123122

124123
// When a tab is shown, reload any CodeMirror instances within
@@ -337,9 +336,9 @@ function ConfigController($scope, $element, $sce) {
337336
function initPlugins() {
338337
var branches = $scope.project.branches;
339338

340-
for (var i = 0; i < branches.length; i++) {
341-
initBranch(branches[i]);
342-
}
339+
branches.forEach(branch => {
340+
initBranch(branch);
341+
});
343342
}
344343

345344
$scope.saveGeneralBranch = function (plugins) {

0 commit comments

Comments
 (0)