BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
32060d45
Unverified
Commit
32060d45
authored
Aug 18, 2016
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved truncation method chain to utility method
parent
d8f88aa4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
abuse_reports.js.es6
app/assets/javascripts/abuse_reports.js.es6
+1
-1
text_utility.js
app/assets/javascripts/lib/utils/text_utility.js
+4
-1
No files found.
app/assets/javascripts/abuse_reports.js.es6
View file @
32060d45
...
...
@@ -17,7 +17,7 @@ window.gl = window.gl || {};
if (reportMessage.length > MAX_MESSAGE_LENGTH) {
$messageCellElement.data('original-message', reportMessage);
$messageCellElement.data('message-truncated', 'true');
$messageCellElement.text(
`${reportMessage.substr(0, (MAX_MESSAGE_LENGTH - 3))}...`
);
$messageCellElement.text(
global.text.truncate(reportMessage, MAX_MESSAGE_LENGTH)
);
}
}
...
...
app/assets/javascripts/lib/utils/text_utility.js
View file @
32060d45
...
...
@@ -104,9 +104,12 @@
return
self
.
updateText
(
$this
.
closest
(
'.md-area'
).
find
(
'textarea'
),
$this
.
data
(
'md-tag'
),
$this
.
data
(
'md-block'
),
!
$this
.
data
(
'md-prepend'
));
});
};
return
gl
.
text
.
removeListeners
=
function
(
form
)
{
gl
.
text
.
removeListeners
=
function
(
form
)
{
return
$
(
'.js-md'
,
form
).
off
();
};
return
gl
.
text
.
truncate
=
function
(
string
,
maxLength
)
{
return
string
.
substr
(
0
,
(
maxLength
-
3
))
+
'...'
;
};
})(
window
);
}).
call
(
this
);
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