summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-07-18 15:00:25 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-07-18 15:00:25 +0100
commit3bb3320a49b5396479cf13ce9447f9c4b6ac09d8 (patch)
tree94fa1ce02c532ac6ab2b0b26ffa11345288483bf
parent09d5cb709a844ec4a867323ba026a7f86330b704 (diff)
downloadgitlab-ce-3bb3320a49b5396479cf13ce9447f9c4b6ac09d8.tar.gz
Dried repo_editor editMode codeclimate reported code
-rw-r--r--app/assets/javascripts/repo/repo_editor.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/assets/javascripts/repo/repo_editor.js b/app/assets/javascripts/repo/repo_editor.js
index 06f08f06d4d..8e7445d7708 100644
--- a/app/assets/javascripts/repo/repo_editor.js
+++ b/app/assets/javascripts/repo/repo_editor.js
@@ -72,18 +72,19 @@ export default class RepoEditor {
},
editMode() {
+ const panelClassList = document.querySelector('.panel-right').classList;
+ let readOnly = true;
+
if (this.editMode) {
- document.querySelector('.panel-right').classList.add('edit-mode');
- self.monacoEditor.updateOptions({
- readOnly: false,
- });
+ panelClassList.add('edit-mode');
} else {
- document.querySelector('.panel-right').classList.remove('edit-mode');
-
- self.monacoEditor.updateOptions({
- readOnly: true,
- });
+ panelClassList.remove('edit-mode');
+ readOnly = true;
}
+
+ self.monacoEditor.updateOptions({
+ readOnly,
+ });
},
activeFileLabel() {