Chat avatar fixes (#9103)

* Ensured rejection doesn't hurt performance

* Added debounce and scroll removal

* Added debounce for keydown

* Fixed linting
This commit is contained in:
Keith Holliday
2017-09-29 16:03:43 -05:00
committed by Sabe Jones
parent dc3a02bc2e
commit 7671347d3a
4 changed files with 51 additions and 16 deletions

View File

@@ -431,6 +431,7 @@
</style>
<script>
import debounce from 'lodash/debounce';
import extend from 'lodash/extend';
import groupUtilities from 'client/mixins/groupsUtilities';
import styleHelper from 'client/mixins/styleHelper';
@@ -655,7 +656,10 @@ export default {
};
document.body.removeChild(div);
},
updateCarretPosition (eventUpdate) {
updateCarretPosition: debounce(function updateCarretPosition (eventUpdate) {
this._updateCarretPosition(eventUpdate);
}, 250),
_updateCarretPosition (eventUpdate) {
if (eventUpdate.metaKey && eventUpdate.keyCode === 13) {
this.sendMessage();
return;