Skip to content

[IMPROVE] Messagebox fix performance#11686

Merged
ggazzo merged 5 commits intodevelopfrom
messagebox-fix-performance
Aug 13, 2018
Merged

[IMPROVE] Messagebox fix performance#11686
ggazzo merged 5 commits intodevelopfrom
messagebox-fix-performance

Conversation

@ggazzo
Copy link
Copy Markdown
Member

@ggazzo ggazzo commented Aug 7, 2018

should close #10583

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11686 August 7, 2018 01:52 Inactive
@ggazzo ggazzo temporarily deployed to rocket-chat-pr-11686 August 7, 2018 01:59 Inactive
Copy link
Copy Markdown
Contributor

@rssilva rssilva left a comment

Choose a reason for hiding this comment

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

Awesome! 🔥
One small change and I think that we are good to go!

* http://github.com/jaz303/jquery-grab-bag/tree/master/javascripts/jquery.autogrow-textarea.js
*/
$.fn.autogrow = function(options) {
var shadow = $("div.autogrow-shadow");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use let here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we could add a TODO and investigate if there is a way to pass the container element to search this .autogrow-shadow class. Doing like this we are looking at the whole DOM.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

actually this code was a copy/paste thats why I'm not using >ES5 on code (just were I changed)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

and about the find, we can use body > .autogrow-shadow or use an id instead, but this code just runs "one time"(one time per opened room) so I dont think will change a lot, but I will change

@rssilva
Copy link
Copy Markdown
Contributor

rssilva commented Aug 7, 2018

It seems that the keypress event was decreased to the half 🎉

current:

screen shot 2018-08-07 at 11 32 34 am

this branch:

screen shot 2018-08-07 at 11 32 51 am

Also, take a look at the key down improvement 👀

@engelgabriel
Copy link
Copy Markdown
Member

@ggazzo ggazzo merged commit 216a574 into develop Aug 13, 2018
@ggazzo ggazzo deleted the messagebox-fix-performance branch August 13, 2018 14:40
@ggazzo ggazzo changed the title [WIP] Messagebox fix performance [IMPROVE] Messagebox fix performance Aug 13, 2018
@sampaiodiego sampaiodiego mentioned this pull request Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typing a message becomes slower the more lines the message contains

3 participants