diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-16 12:06:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-16 12:06:25 +0300 |
commit | d8211a0ed119eada7d292e974a8fc7b0cd982d3c (patch) | |
tree | a14bfca83dd6b71144959d7e7a6d058f5d8922a5 /app/assets/javascripts/diffs/index.js | |
parent | edd042071d1b5e6f494881dc2d9c39b46e42f74b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs/index.js')
-rw-r--r-- | app/assets/javascripts/diffs/index.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/diffs/index.js b/app/assets/javascripts/diffs/index.js index 1e57e9b8a30..c9580e3d3b4 100644 --- a/app/assets/javascripts/diffs/index.js +++ b/app/assets/javascripts/diffs/index.js @@ -74,6 +74,7 @@ export default function initDiffsApp(store) { isFluidLayout: parseBoolean(dataset.isFluidLayout), dismissEndpoint: dataset.dismissEndpoint, showSuggestPopover: parseBoolean(dataset.showSuggestPopover), + showWhitespaceDefault: parseBoolean(dataset.showWhitespaceDefault), }; }, computed: { @@ -82,11 +83,15 @@ export default function initDiffsApp(store) { }), }, created() { + let hideWhitespace = getParameterValues('w')[0]; const treeListStored = localStorage.getItem(TREE_LIST_STORAGE_KEY); const renderTreeList = treeListStored !== null ? parseBoolean(treeListStored) : true; this.setRenderTreeList(renderTreeList); - this.setShowWhitespace({ showWhitespace: getParameterValues('w')[0] !== '1' }); + if (!hideWhitespace) { + hideWhitespace = this.showWhitespaceDefault ? '0' : '1'; + } + this.setShowWhitespace({ showWhitespace: hideWhitespace !== '1' }); }, methods: { ...mapActions('diffs', ['setRenderTreeList', 'setShowWhitespace']), @@ -103,6 +108,7 @@ export default function initDiffsApp(store) { isFluidLayout: this.isFluidLayout, dismissEndpoint: this.dismissEndpoint, showSuggestPopover: this.showSuggestPopover, + showWhitespaceDefault: this.showWhitespaceDefault, }, }); }, |