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
d8546930
Commit
d8546930
authored
Dec 03, 2020
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Centralize how the Diffs app attaches/detaches from the event hub
parent
4f37e9d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+12
-9
No files found.
app/assets/javascripts/diffs/components/app.vue
View file @
d8546930
...
...
@@ -283,10 +283,7 @@ export default {
},
created
()
{
this
.
adjustView
();
notesEventHub
.
$once
(
'
fetchDiffData
'
,
this
.
fetchData
);
notesEventHub
.
$on
(
'
refetchDiffData
'
,
this
.
refetchDiffData
);
eventHub
.
$on
(
EVT_VIEW_FILE_BY_FILE
,
this
.
fileByFileListener
);
this
.
subscribeToEvents
();
this
.
CENTERED_LIMITED_CONTAINER_CLASSES
=
CENTERED_LIMITED_CONTAINER_CLASSES
;
...
...
@@ -307,11 +304,7 @@ export default {
},
beforeDestroy
()
{
diffsApp
.
deinstrument
();
eventHub
.
$off
(
EVT_VIEW_FILE_BY_FILE
,
this
.
fileByFileListener
);
notesEventHub
.
$off
(
'
refetchDiffData
'
,
this
.
refetchDiffData
);
notesEventHub
.
$off
(
'
fetchDiffData
'
,
this
.
fetchData
);
this
.
unsubscribeFromEvents
();
this
.
removeEventListeners
();
},
methods
:
{
...
...
@@ -331,6 +324,16 @@ export default {
'
navigateToDiffFileIndex
'
,
'
setFileByFile
'
,
]),
subscribeToEvents
()
{
notesEventHub
.
$once
(
'
fetchDiffData
'
,
this
.
fetchData
);
notesEventHub
.
$on
(
'
refetchDiffData
'
,
this
.
refetchDiffData
);
eventHub
.
$on
(
EVT_VIEW_FILE_BY_FILE
,
this
.
fileByFileListener
);
},
unsubscribeFromEvents
()
{
eventHub
.
$off
(
EVT_VIEW_FILE_BY_FILE
,
this
.
fileByFileListener
);
notesEventHub
.
$off
(
'
refetchDiffData
'
,
this
.
refetchDiffData
);
notesEventHub
.
$off
(
'
fetchDiffData
'
,
this
.
fetchData
);
},
fileByFileListener
({
setting
}
=
{})
{
this
.
setFileByFile
({
fileByFile
:
setting
});
},
...
...
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