1
0
Fork 0
forked from forgejo/forgejo

JS refactors (#22227)

- Replace all default exports with named exports, except for Vue SFCs
- Remove names from Vue SFCs, they are automatically inferred from the
filename
- Misc whitespace-related tweaks
This commit is contained in:
silverwind 2022-12-23 17:03:11 +01:00 committed by GitHub
parent 71ca3067bc
commit 2cf0cf0de1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 47 additions and 89 deletions

View file

@ -21,15 +21,12 @@ const {pageData} = window.config;
const LOCAL_STORAGE_KEY = 'diff_file_tree_visible';
export default {
name: 'DiffFileTree',
components: {DiffFileTreeItem},
data: () => {
const fileTreeIsVisible = localStorage.getItem(LOCAL_STORAGE_KEY) === 'true';
pageData.diffFileInfo.fileTreeIsVisible = fileTreeIsVisible;
return pageData.diffFileInfo;
},
computed: {
fileTree() {
const result = [];
@ -94,7 +91,6 @@ export default {
return result;
}
},
mounted() {
// ensure correct buttons when we are mounted to the dom
this.adjustToggleButton(this.fileTreeIsVisible);
@ -125,7 +121,7 @@ export default {
doLoadMoreFiles(this.link, this.diffEnd, () => {
this.isLoadingNewData = false;
});
}
},
},
};
</script>