summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-03-22 15:46:29 +0000
committerPhil Hughes <me@iamphill.com>2018-03-22 15:46:29 +0000
commit3180f9a6b694066b86c89b3487c13caa1be52b0f (patch)
treec185f563c9792ceb05a489eaa6d3064a0e8d3c48
parentfc2c3560176048911e46724025bb3f6c4fab3a6e (diff)
downloadgitlab-ce-ide-staged-changes.tar.gz
double click to stage & unstage fileside-staged-changes
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/list_item.vue18
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