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
iv
gitlab-ce
Commits
1f711fd9
Commit
1f711fd9
authored
Mar 20, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove upvotes js logic since it does not work as expected anyway
parent
d735321e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
21 deletions
+1
-21
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+1
-1
app/assets/javascripts/notes_votes.js.coffee
app/assets/javascripts/notes_votes.js.coffee
+0
-20
No files found.
app/assets/javascripts/notes.js.coffee
View file @
1f711fd9
...
@@ -425,7 +425,7 @@ class @Notes
...
@@ -425,7 +425,7 @@ class @Notes
@
removeDiscussionNoteForm
(
form
)
@
removeDiscussionNoteForm
(
form
)
updateVotes
:
->
updateVotes
:
->
(
new
NotesVotes
).
updateVotes
()
true
###
###
Called after an attachment file has been selected.
Called after an attachment file has been selected.
...
...
app/assets/javascripts/notes_votes.js.coffee
deleted
100644 → 0
View file @
d735321e
class
@
NotesVotes
updateVotes
:
->
votes
=
$
(
"#votes .votes"
)
notes
=
$
(
"#notes-list .note .vote"
)
# only update if there is a vote display
if
votes
.
size
()
upvotes
=
notes
.
filter
(
".upvote"
).
size
()
downvotes
=
notes
.
filter
(
".downvote"
).
size
()
votesCount
=
upvotes
+
downvotes
upvotesPercent
=
(
if
votesCount
then
(
100.0
/
votesCount
*
upvotes
)
else
0
)
downvotesPercent
=
(
if
votesCount
then
(
100.0
-
upvotesPercent
)
else
0
)
# change vote bar lengths
votes
.
find
(
".bar-success"
).
css
"width"
,
upvotesPercent
+
"%"
votes
.
find
(
".bar-danger"
).
css
"width"
,
downvotesPercent
+
"%"
# replace vote numbers
votes
.
find
(
".upvotes"
).
text
votes
.
find
(
".upvotes"
).
text
().
replace
(
/\d+/
,
upvotes
)
votes
.
find
(
".downvotes"
).
text
votes
.
find
(
".downvotes"
).
text
().
replace
(
/\d+/
,
downvotes
)
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