Skip to content

Commit 487fc3a

Browse files
authored
Use consistent style and remove console.log
1 parent 9c02495 commit 487fc3a

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

spec/_static/javascripts/version_dropdown.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
function assign_href( a, url, path ) {
2-
fetch( url + "/" + path ).then( response => {
3-
if( response.ok ){
1+
function assign_href(a, url, path) {
2+
fetch(url + "/" + path).then(response => {
3+
if (response.ok){
44
a.href = url + "/" + path;
5-
}
6-
else {
5+
} else {
76
a.href = url + "/index.html";
87
}
9-
}).catch( error => {
8+
}).catch(error => {
109
a.href = url + "/index.html";
1110
});
1211
}
@@ -22,17 +21,16 @@ function add_version_dropdown(json_loc, target_loc, text) {
2221
dropdown.appendChild(content);
2322
$.getJSON(json_loc, function(versions) {
2423
var currentURL = window.location.href;
25-
var path = currentURL.split( "_site" )[ 1 ];
26-
path = path.split('/');
24+
var path = currentURL.split("_site")[1];
25+
path = path.split("/");
2726
path = path.slice(2, path.length);
28-
path = path.join('/');
27+
path = path.join("/");
2928
for (var key in versions) {
3029
if (versions.hasOwnProperty(key)) {
31-
console.log(key, versions[key]);
3230
var a = document.createElement("a");
3331
a.innerHTML = key;
3432
a.title = key;
35-
assign_href( a, target_loc + versions[key], path );
33+
assign_href(a, target_loc + versions[key], path);
3634
content.appendChild(a);
3735
}
3836
}

0 commit comments

Comments
 (0)