Skip to content

Commit

Permalink
Fix for version config option anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
davidBar-On authored and calebcartwright committed Aug 18, 2021
1 parent ec86cfd commit f787288
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/index.html
Expand Up @@ -72,8 +72,8 @@
<input type="checkbox" id="stable" v-model="shouldStable">
</div>
<div>
<label for="version">version: </label>
<select name="version" id="version" v-model="version">
<label for="viewVersion">version: </label>
<select name="viewVersion" id="viewVersion" v-model="viewVersion">
<option v-for="option in versionOptions" v-bind:value="option">
{{ option }}
</option>
Expand Down Expand Up @@ -107,8 +107,8 @@
configurationDescriptions: [],
searchCondition: searchTerm,
shouldStable: false,
version: versionNumber,
oldVersion: undefined,
viewVersion: versionNumber,
oldViewVersion: undefined,
versionOptions: ['master'],
scrolledOnce: false,
},
Expand All @@ -122,13 +122,13 @@
return;
}
if (versionParam == null) {
this.version = latest.name;
this.viewVersion = latest.name;
}
},
async outputHtml() {
if (this.version !== this.oldVersion) {
if (this.viewVersion !== this.oldViewVersion) {
const ConfigurationMdUrl =
`https://raw.githubusercontent.com/rust-lang/rustfmt/${this.version}/Configurations.md`;
`https://raw.githubusercontent.com/rust-lang/rustfmt/${this.viewVersion}/Configurations.md`;
let res;
try {
res = await axios.get(ConfigurationMdUrl).catch(e => { throw e });
Expand All @@ -144,7 +144,7 @@
this.aboutHtml = marked.parser(about);
this.configurationAboutHtml = marked.parser(configurationAbout);
this.configurationDescriptions = configurationDescriptions;
this.oldVersion = this.version;
this.oldViewVersion = this.viewVersion;
}

const ast = this.configurationDescriptions
Expand All @@ -162,7 +162,7 @@
}, []);
ast.links = {};

queryParams.set('version', this.version);
queryParams.set('version', this.viewVersion);
queryParams.set('search', this.searchCondition);
const curUrl = window.location.pathname +
'?' + queryParams.toString() + window.location.hash;
Expand Down

0 comments on commit f787288

Please sign in to comment.