emit timeline_resize in MatrixChat based on ResizeNotifier
as it's used in PersistentElement which could be used at various placespull/21833/head
parent
735b4f6fcf
commit
56aeb5194a
|
@ -318,6 +318,9 @@ export default React.createClass({
|
||||||
// N.B. we don't call the whole of setTheme() here as we may be
|
// N.B. we don't call the whole of setTheme() here as we may be
|
||||||
// racing with the theme CSS download finishing from index.js
|
// racing with the theme CSS download finishing from index.js
|
||||||
Tinter.tint();
|
Tinter.tint();
|
||||||
|
|
||||||
|
// For PersistentElement
|
||||||
|
this.state.resizeNotifier.on("middlePanelResized", this._dispatchTimelineResize);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
|
@ -400,6 +403,7 @@ export default React.createClass({
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
window.removeEventListener("focus", this.onFocus);
|
window.removeEventListener("focus", this.onFocus);
|
||||||
window.removeEventListener('resize', this.handleResize);
|
window.removeEventListener('resize', this.handleResize);
|
||||||
|
this.state.resizeNotifier.removeListener("middlePanelResized", this._dispatchTimelineResize);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillUpdate: function(props, state) {
|
componentWillUpdate: function(props, state) {
|
||||||
|
@ -1667,6 +1671,10 @@ export default React.createClass({
|
||||||
this._windowWidth = window.innerWidth;
|
this._windowWidth = window.innerWidth;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_dispatchTimelineResize() {
|
||||||
|
dis.dispatch({ action: 'timeline_resize' }, true);
|
||||||
|
},
|
||||||
|
|
||||||
onRoomCreated: function(roomId) {
|
onRoomCreated: function(roomId) {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: "view_room",
|
action: "view_room",
|
||||||
|
|
|
@ -21,7 +21,6 @@ import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import shouldHideEvent from '../../shouldHideEvent';
|
import shouldHideEvent from '../../shouldHideEvent';
|
||||||
import {wantsDateSeparator} from '../../DateUtils';
|
import {wantsDateSeparator} from '../../DateUtils';
|
||||||
import dis from "../../dispatcher";
|
|
||||||
import sdk from '../../index';
|
import sdk from '../../index';
|
||||||
|
|
||||||
import MatrixClientPeg from '../../MatrixClientPeg';
|
import MatrixClientPeg from '../../MatrixClientPeg';
|
||||||
|
@ -665,10 +664,6 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onResize: function() {
|
|
||||||
dis.dispatch({ action: 'timeline_resize' }, true);
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
|
const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
|
||||||
const WhoIsTypingTile = sdk.getComponent("rooms.WhoIsTypingTile");
|
const WhoIsTypingTile = sdk.getComponent("rooms.WhoIsTypingTile");
|
||||||
|
|
|
@ -856,10 +856,6 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onSearchResultsResize: function() {
|
|
||||||
dis.dispatch({ action: 'timeline_resize' }, true);
|
|
||||||
},
|
|
||||||
|
|
||||||
onSearchResultsFillRequest: function(backwards) {
|
onSearchResultsFillRequest: function(backwards) {
|
||||||
if (!backwards) {
|
if (!backwards) {
|
||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
|
@ -1794,7 +1790,6 @@ module.exports = React.createClass({
|
||||||
<ScrollPanel ref="searchResultsPanel"
|
<ScrollPanel ref="searchResultsPanel"
|
||||||
className="mx_RoomView_messagePanel mx_RoomView_searchResultsPanel"
|
className="mx_RoomView_messagePanel mx_RoomView_searchResultsPanel"
|
||||||
onFillRequest={this.onSearchResultsFillRequest}
|
onFillRequest={this.onSearchResultsFillRequest}
|
||||||
onResize={this.onSearchResultsResize}
|
|
||||||
>
|
>
|
||||||
<li className={scrollheader_classes}></li>
|
<li className={scrollheader_classes}></li>
|
||||||
{ this.getSearchResultTiles() }
|
{ this.getSearchResultTiles() }
|
||||||
|
|
Loading…
Reference in New Issue