summaryrefslogtreecommitdiffstats
path: root/webapp/utils/utils.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r--webapp/utils/utils.jsx24
1 files changed, 10 insertions, 14 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 84b02beb1..6ef267eed 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -388,14 +388,6 @@ export function insertHtmlEntities(text) {
return newtext;
}
-export function searchForTerm(term) {
- AppDispatcher.handleServerAction({
- type: ActionTypes.RECEIVED_SEARCH_TERM,
- term,
- do_search: true
- });
-}
-
export function getFileType(extin) {
var ext = extin.toLowerCase();
if (Constants.IMAGE_TYPES.indexOf(ext) > -1) {
@@ -1312,16 +1304,11 @@ export function isValidPassword(password) {
}
export function handleFormattedTextClick(e) {
- const mentionAttribute = e.target.getAttributeNode('data-mention');
const hashtagAttribute = e.target.getAttributeNode('data-hashtag');
const linkAttribute = e.target.getAttributeNode('data-link');
const channelMentionAttribute = e.target.getAttributeNode('data-channel-mention');
- if (mentionAttribute) {
- e.preventDefault();
-
- searchForTerm(mentionAttribute.value);
- } else if (hashtagAttribute) {
+ if (hashtagAttribute) {
e.preventDefault();
searchForTerm(hashtagAttribute.value);
@@ -1339,6 +1326,15 @@ export function handleFormattedTextClick(e) {
}
}
+// This should eventually be removed once everywhere else calls the action
+function searchForTerm(term) {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_SEARCH_TERM,
+ term,
+ do_search: true
+ });
+}
+
export function isEmptyObject(object) {
if (!object) {
return true;