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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
1f27c638
Commit
1f27c638
authored
Apr 05, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `isInVueNoteablePage` from dom_utils
parent
10143937
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
app/assets/javascripts/awards_handler.js
app/assets/javascripts/awards_handler.js
+4
-11
No files found.
app/assets/javascripts/awards_handler.js
View file @
1f27c638
...
@@ -4,7 +4,8 @@ import $ from 'jquery';
...
@@ -4,7 +4,8 @@ import $ from 'jquery';
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
{
__
}
from
'
./locale
'
;
import
{
__
}
from
'
./locale
'
;
import
{
isInIssuePage
,
isInMRPage
,
isInEpicPage
,
hasVueMRDiscussionsCookie
,
updateTooltipTitle
}
from
'
./lib/utils/common_utils
'
;
import
{
updateTooltipTitle
}
from
'
./lib/utils/common_utils
'
;
import
{
isInVueNoteablePage
}
from
'
./lib/utils/dom_utils
'
;
import
flash
from
'
./flash
'
;
import
flash
from
'
./flash
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
...
@@ -243,7 +244,7 @@ class AwardsHandler {
...
@@ -243,7 +244,7 @@ class AwardsHandler {
addAward
(
votesBlock
,
awardUrl
,
emoji
,
checkMutuality
,
callback
)
{
addAward
(
votesBlock
,
awardUrl
,
emoji
,
checkMutuality
,
callback
)
{
const
isMainAwardsBlock
=
votesBlock
.
closest
(
'
.js-noteable-awards
'
).
length
;
const
isMainAwardsBlock
=
votesBlock
.
closest
(
'
.js-noteable-awards
'
).
length
;
if
(
this
.
isInVueNoteablePage
()
&&
!
isMainAwardsBlock
)
{
if
(
isInVueNoteablePage
()
&&
!
isMainAwardsBlock
)
{
const
id
=
votesBlock
.
attr
(
'
id
'
).
replace
(
'
note_
'
,
''
);
const
id
=
votesBlock
.
attr
(
'
id
'
).
replace
(
'
note_
'
,
''
);
this
.
hideMenuElement
(
$
(
'
.emoji-menu
'
));
this
.
hideMenuElement
(
$
(
'
.emoji-menu
'
));
...
@@ -295,16 +296,8 @@ class AwardsHandler {
...
@@ -295,16 +296,8 @@ class AwardsHandler {
}
}
}
}
isVueMRDiscussions
()
{
return
isInMRPage
()
&&
hasVueMRDiscussionsCookie
()
&&
!
$
(
'
#diffs
'
).
is
(
'
:visible
'
);
}
isInVueNoteablePage
()
{
return
isInIssuePage
()
||
isInEpicPage
()
||
this
.
isVueMRDiscussions
();
}
getVotesBlock
()
{
getVotesBlock
()
{
if
(
this
.
isInVueNoteablePage
())
{
if
(
isInVueNoteablePage
())
{
const
$el
=
$
(
'
.js-add-award.is-active
'
).
closest
(
'
.note.timeline-entry
'
);
const
$el
=
$
(
'
.js-add-award.is-active
'
).
closest
(
'
.note.timeline-entry
'
);
if
(
$el
.
length
)
{
if
(
$el
.
length
)
{
...
...
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