PLT-4404/PLT-4578/PLT-4541/PLT-4542 Replaced third party autosizing textarea with a custom one (#4442)

* PLT-4578 Replaced third party autosizing textarea with a custom one

* Fix Textbox.handleHeightChange not being called

* Removed unused CSS

* PLT-4541 Force EditPostModal to resize upon opening

* Removed usage of jquery from AutosizeTextarea

* Reverted changes made for PLT-4580 as they're no longer needed
Этот коммит содержится в:
Harrison Healey
2016-11-04 12:35:38 -04:00
коммит произвёл Christopher Speller
родитель 7403bbce69
Коммит e63e80dee0
8 изменённых файлов: 138 добавлений и 87 удалений

Просмотреть файл

@@ -25,6 +25,7 @@ export default class Textbox extends React.Component {
super(props);
this.focus = this.focus.bind(this);
this.recalculateSize = this.recalculateSize.bind(this);
this.getStateFromStores = this.getStateFromStores.bind(this);
this.onRecievedError = this.onRecievedError.bind(this);
this.handleKeyPress = this.handleKeyPress.bind(this);
@@ -91,13 +92,10 @@ export default class Textbox extends React.Component {
}
}
handleHeightChange(height) {
const textbox = $(this.refs.message.getTextbox());
handleHeightChange(height, maxHeight) {
const wrapper = $(this.refs.wrapper);
const maxHeight = parseInt(textbox.css('max-height'), 10);
// move over attachment icon to compensate for the scrollbar
// Move over attachment icon to compensate for the scrollbar
if (height > maxHeight) {
wrapper.closest('.post-body__cell').addClass('scroll');
} else {
@@ -106,7 +104,14 @@ export default class Textbox extends React.Component {
}
focus() {
this.refs.message.getTextbox().focus();
const textbox = this.refs.message.getTextbox();
textbox.focus();
Utils.placeCaretAtEnd(textbox);
}
recalculateSize() {
this.refs.message.recalculateSize();
}
showPreview(e) {