Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
6fdca886
Commit
6fdca886
authored
9 years ago
by
Gabriel Engel
Browse files
Options
Downloads
Plain Diff
Merge pull request #1421 from RocketChat/packaged-interface
fixed cog editing bug
parents
525207cf
3dcdcc6f
No related branches found
Branches containing commit
Tags
6.0.0-rc.7
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/rocketchat-lib/client/MessageAction.coffee
+7
-7
7 additions, 7 deletions
packages/rocketchat-lib/client/MessageAction.coffee
with
7 additions
and
7 deletions
packages/rocketchat-lib/client/MessageAction.coffee
+
7
−
7
View file @
6fdca886
RocketChat
.
MessageAction
=
new
class
buttons
=
new
ReactiveVar
{}
###
config expects the following keys (only id is mandatory):
id (mandatory)
...
...
@@ -9,7 +9,7 @@ RocketChat.MessageAction = new class
action: function(event, instance)
validation: function(message)
order: integer
###
###
addButton
=
(
config
)
->
unless
config
?
.
id
throw
new
Meteor
.
Error
"MessageAction-addButton-error"
,
"Button id was not informed."
...
...
@@ -29,18 +29,18 @@ RocketChat.MessageAction = new class
Tracker
.
nonreactive
->
btns
=
buttons
.
get
()
if
btns
[
id
]
btns
[
id
]
=
_
.
extend
btns
[
id
],
config
btns
[
id
]
=
_
.
extend
btns
[
id
],
config
buttons
.
set
btns
getButtons
=
(
message
)
->
allButtons
=
_
.
toArray
buttons
.
get
()
if
message
allowedButtons
=
_
.
compact
_
.
map
allButtons
,
(
button
)
->
allowedButtons
=
_
.
compact
_
.
map
allButtons
,
(
button
)
->
if
not
button
.
validation
?
or
button
.
validation
(
message
)
return
button
else
allowedButtons
=
allButtons
return
_
.
sortBy
allowedButtons
,
'order'
resetButtons
=
->
...
...
@@ -59,7 +59,7 @@ Meteor.startup ->
i18nLabel
:
'Edit'
action
:
(
event
,
instance
)
->
message
=
$
(
event
.
currentTarget
).
closest
(
'.message'
)[
0
]
instance
.
chatMessages
.
edit
(
message
)
chatMessages
[
Session
.
get
(
'openedRoom'
)]
.
edit
(
message
)
$
(
"
\#
#{
message
.
id
}
.message-dropdown"
).
hide
()
input
=
instance
.
find
(
'.input-message'
)
Meteor
.
setTimeout
->
...
...
@@ -108,7 +108,7 @@ Meteor.startup ->
timer
:
1000
showConfirmButton
:
false
instance
.
chatMessages
.
deleteMsg
(
message
)
chatMessages
[
Session
.
get
(
'openedRoom'
)]
.
deleteMsg
(
message
)
validation
:
(
message
)
->
return
RocketChat
.
authz
.
hasAtLeastOnePermission
(
'delete-message'
,
message
.
rid
)
or
RocketChat
.
settings
.
get
(
'Message_AllowDeleting'
)
and
message
.
u
?
.
_id
is
Meteor
.
userId
()
order
:
2
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment