summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2016-07-15 19:46:26 +0100
committerLuke Bennett <lukeeeebennettplus@gmail.com>2016-08-14 00:54:18 +0100
commitff3dc13f90da40e94aac117402648cc336ba72ad (patch)
tree0cf7ff773f462fa9c64824573d5def64eb7bf0ab
parent6b7c0a93d3b21dd024feedc9501b24729cbb1026 (diff)
downloadgitlab-ce-ff3dc13f90da40e94aac117402648cc336ba72ad.tar.gz
Review changes
-rw-r--r--app/assets/javascripts/abuse_reports.js.coffee30
-rw-r--r--app/assets/stylesheets/pages/admin.scss13
2 files changed, 25 insertions, 18 deletions
diff --git a/app/assets/javascripts/abuse_reports.js.coffee b/app/assets/javascripts/abuse_reports.js.coffee
index de768b12ef9..e9bd854044a 100644
--- a/app/assets/javascripts/abuse_reports.js.coffee
+++ b/app/assets/javascripts/abuse_reports.js.coffee
@@ -1,26 +1,28 @@
class @AbuseReports
MAX_MESSAGE_LENGTH = 300
- MESSAGE_CELL_SELECTOR = 'table tbody tr td:nth-child(3)'
+ MESSAGE_CELL_SELECTOR = '.abuse-reports td:nth-child(3)'
constructor: ->
$(MESSAGE_CELL_SELECTOR).each @truncateLongMessage
- $(document).on 'click', "#{MESSAGE_CELL_SELECTOR}", @toggleMessageTruncation
+ $(document)
+ .off 'click', MESSAGE_CELL_SELECTOR
+ .on 'click', MESSAGE_CELL_SELECTOR, @toggleMessageTruncation
truncateLongMessage: ->
- messageCellElement = $(this)
- reportMessage = messageCellElement.text()
+ $messageCellElement = $(this)
+ reportMessage = $messageCellElement.text()
if reportMessage.length > MAX_MESSAGE_LENGTH
- messageCellElement.attr 'data-original-message', reportMessage
- messageCellElement.attr 'data-message-truncated', 'true'
- messageCellElement.text "#{reportMessage.substr 0, MAX_MESSAGE_LENGTH}..."
+ $messageCellElement.data 'original-message', reportMessage
+ $messageCellElement.data 'message-truncated', 'true'
+ $messageCellElement.text "#{reportMessage.substr 0, MAX_MESSAGE_LENGTH}..."
toggleMessageTruncation: ->
- messageCellElement = $(this)
- originalMessage = messageCellElement.attr 'data-original-message'
+ $messageCellElement = $(this)
+ originalMessage = $messageCellElement.data 'original-message'
return if not originalMessage
- if messageCellElement.attr('data-message-truncated') is 'true'
- messageCellElement.attr 'data-message-truncated', 'false'
- messageCellElement.text originalMessage
+ if $messageCellElement.data('message-truncated') is 'true'
+ $messageCellElement.data 'message-truncated', 'false'
+ $messageCellElement.text originalMessage
else
- messageCellElement.attr 'data-message-truncated', 'true'
- messageCellElement.text "#{originalMessage.substr 0, MAX_MESSAGE_LENGTH}..."
+ $messageCellElement.data 'message-truncated', 'true'
+ $messageCellElement.text "#{originalMessage.substr 0, MAX_MESSAGE_LENGTH}..."
diff --git a/app/assets/stylesheets/pages/admin.scss b/app/assets/stylesheets/pages/admin.scss
index dd3df93a200..4ea8292ec2a 100644
--- a/app/assets/stylesheets/pages/admin.scss
+++ b/app/assets/stylesheets/pages/admin.scss
@@ -100,10 +100,15 @@
.abuse-reports {
table-layout: fixed;
- td {
- vertical-align: top !important;
- &.action-buttons a {
- white-space: normal;
+ .action-buttons a {
+ white-space: normal;
+ }
+ @media (min-width: $screen-sm-min) {
+ th {
+ width: 15%;
+ &.wide {
+ width: 55%;
+ }
}
}
}