Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8c4ad738
Commit
8c4ad738
authored
Mar 27, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stops opening a pending tab if current tab is in review mode already
parent
53707c83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
...s/javascripts/ide/components/commit_sidebar/list_item.vue
+4
-2
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+7
-1
No files found.
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
View file @
8c4ad738
...
...
@@ -23,8 +23,10 @@ export default {
methods
:
{
...
mapActions
([
'
discardFileChanges
'
,
'
updateViewer
'
,
'
openPendingTab
'
]),
openFileInEditor
(
file
)
{
return
this
.
updateViewer
(
'
diff
'
).
then
(()
=>
{
this
.
openPendingTab
(
file
);
return
this
.
openPendingTab
(
file
).
then
(
changeViewer
=>
{
if
(
changeViewer
)
{
this
.
updateViewer
(
'
diff
'
);
}
});
},
},
...
...
app/assets/javascripts/ide/stores/actions/file.js
View file @
8c4ad738
...
...
@@ -138,12 +138,18 @@ export const discardFileChanges = ({ state, commit }, path) => {
eventHub
.
$emit
(
`editor.update.model.content.
${
file
.
path
}
`
,
file
.
raw
);
};
export
const
openPendingTab
=
({
commit
,
dispatch
,
state
},
file
)
=>
{
export
const
openPendingTab
=
({
commit
,
getters
,
dispatch
,
state
},
file
)
=>
{
if
(
getters
.
activeFile
&&
getters
.
activeFile
.
path
===
file
.
path
&&
state
.
viewer
===
'
diff
'
)
{
return
false
;
}
commit
(
types
.
ADD_PENDING_TAB
,
file
);
dispatch
(
'
scrollToTab
'
);
router
.
push
(
`/project/
${
file
.
projectId
}
/tree/
${
state
.
currentBranchId
}
/`
);
return
true
;
};
export
const
removePendingTab
=
({
commit
},
file
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment