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
01cddb79
Commit
01cddb79
authored
Nov 13, 2019
by
Arun Kumar Mohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove IIFEs from notes
parent
9faa870e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
56 deletions
+44
-56
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+44
-56
No files found.
app/assets/javascripts/notes.js
View file @
01cddb79
/* eslint-disable no-restricted-properties,
func-names,
no-var, camelcase,
/* eslint-disable no-restricted-properties, no-var, camelcase,
no-unused-expressions, one-var, default-case,
consistent-return, no-alert, no-
return-assig
n,
no-param-reassign, no-else-return, vars-on-top
,
no-shadow, no-useless-escape,
class-methods-use-this */
consistent-return, no-alert, no-
param-reassign, no-else-retur
n,
vars-on-top, no-shadow, no-useless-escape
,
class-methods-use-this */
/* global ResolveService */
...
...
@@ -281,14 +281,7 @@ export default class Notes {
if
(
Notes
.
interval
)
{
clearInterval
(
Notes
.
interval
);
}
return
(
Notes
.
interval
=
setInterval
(
(
function
(
_this
)
{
return
function
()
{
return
_this
.
refresh
();
};
})(
this
),
this
.
pollingInterval
,
));
Notes
.
interval
=
setInterval
(()
=>
this
.
refresh
(),
this
.
pollingInterval
);
}
refresh
()
{
...
...
@@ -847,15 +840,12 @@ export default class Notes {
var
noteElId
,
$note
;
$note
=
$
(
e
.
currentTarget
).
closest
(
'
.note
'
);
noteElId
=
$note
.
attr
(
'
id
'
);
$
(
`.note[id="
${
noteElId
}
"]`
).
each
(
(
function
()
{
$
(
`.note[id="
${
noteElId
}
"]`
).
each
((
i
,
el
)
=>
{
// A same note appears in the "Discussion" and in the "Changes" tab, we have
// to remove all. Using $('.note[id='noteId']') ensure we get all the notes,
// where $('#noteId') would return only one.
return
function
(
i
,
el
)
{
var
$note
,
$notes
;
$note
=
$
(
el
);
$notes
=
$note
.
closest
(
'
.discussion-notes
'
);
const
$note
=
$
(
el
);
const
$notes
=
$note
.
closest
(
'
.discussion-notes
'
);
const
discussionId
=
$
(
'
.notes
'
,
$notes
).
data
(
'
discussionId
'
);
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'
undefined
'
)
{
...
...
@@ -868,7 +858,7 @@ export default class Notes {
// check if this is the last note for this line
if
(
$notes
.
find
(
'
.note
'
).
length
===
0
)
{
var
notesTr
=
$notes
.
closest
(
'
tr
'
);
const
notesTr
=
$notes
.
closest
(
'
tr
'
);
// "Discussions" tab
$notes
.
closest
(
'
.timeline-entry
'
).
remove
();
...
...
@@ -895,9 +885,7 @@ export default class Notes {
notesTr
.
remove
();
}
}
};
})(
this
),
);
});
Notes
.
checkMergeRequestStatus
();
return
this
.
updateNotesCount
(
-
1
);
...
...
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