diff options
author | Phil Hughes <me@iamphill.com> | 2018-03-22 15:46:29 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-03-22 15:46:29 +0000 |
commit | 3180f9a6b694066b86c89b3487c13caa1be52b0f (patch) | |
tree | c185f563c9792ceb05a489eaa6d3064a0e8d3c48 /app | |
parent | fc2c3560176048911e46724025bb3f6c4fab3a6e (diff) | |
download | gitlab-ce-3180f9a6b694066b86c89b3487c13caa1be52b0f.tar.gz |
double click to stage & unstage fileside-staged-changes
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/ide/components/commit_sidebar/list_item.vue | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue b/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue index 5a4547e5a86..8f09d0c971a 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue @@ -32,14 +32,18 @@ export default { }, }, methods: { - ...mapActions(['updateViewer']), - openFileInEditor(file) { + ...mapActions(['updateViewer', 'stageChange', 'unstageChange']), + openFileInEditor() { this.updateViewer('diff'); - router.push(`/project${file.url}`); + router.push(`/project${this.file.url}`); }, - stageFile() { - alert('a'); + fileAction() { + if (this.file.staged) { + this.unstageChange(this.file.path); + } else { + this.stageChange(this.file.path); + } }, }, }; @@ -50,8 +54,8 @@ export default { <button type="button" class="multi-file-commit-list-path" - @dblclick="stageFile" - @click="openFileInEditor(file)" + @dblclick="fileAction" + @click="openFileInEditor" > <span class="multi-file-commit-list-file-path"> <icon |