Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/notes_votes.js.coffee')
-rw-r--r--app/assets/javascripts/notes_votes.js.coffee20
1 files changed, 0 insertions, 20 deletions
diff --git a/app/assets/javascripts/notes_votes.js.coffee b/app/assets/javascripts/notes_votes.js.coffee
deleted file mode 100644
index 65c149b7886..00000000000
--- a/app/assets/javascripts/notes_votes.js.coffee
+++ /dev/null
@@ -1,20 +0,0 @@
-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)