Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes rtl check in ChatMessages class #4049

Merged
merged 8 commits into from
Aug 25, 2016
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/rocketchat-authorization/server/startup.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Meteor.startup ->
{ _id: 'set-owner', roles : ['admin', 'owner'] }
{ _id: 'unarchive-room', roles : ['admin'] }
{ _id: 'view-c-room', roles : ['admin', 'user', 'bot'] }
{ _id: 'view-d-room', roles : ['admin', 'user'] }
{ _id: 'view-d-room', roles : ['admin', 'user', 'bot'] }
{ _id: 'view-full-other-user-info', roles : ['admin'] }
{ _id: 'view-history', roles : ['user'] }
{ _id: 'view-history', roles : ['admin', 'user', 'bot'] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some un-related changes made it in with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh i forgot about these! removing now

{ _id: 'view-joined-room', roles: ['guest'] }
{ _id: 'view-logs', roles : ['admin'] }
{ _id: 'view-other-user-channels', roles : ['admin'] }
Expand Down
5 changes: 3 additions & 2 deletions packages/rocketchat-ui/lib/chatMessages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,9 @@ class @ChatMessages
else if k is 75 and ((navigator?.platform?.indexOf('Mac') isnt -1 and event.metaKey and event.shiftKey) or (navigator?.platform?.indexOf('Mac') is -1 and event.ctrlKey and event.shiftKey))
RoomHistoryManager.clear rid

valueChanged: (rid, event) ->
this.determineInputDirection()
valueChanged: (rid, event, input) ->
if this.input.value.length is 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work! You can't use this.input there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested here and worked, why do you think it wont work? also the derermineInputDirection() method uses this.input too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I didn't realize this.input is defined inside the class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

this.determineInputDirection()

determineInputDirection: () ->
this.input.dir = if this.isMessageRtl(this.input.value) then 'rtl' else 'ltr'
Expand Down