Merge pull request #260 from matrix-org/matthew/preview_urls
URL previewing support
This commit is contained in:
commit
f9c7ae1ab9
11 changed files with 312 additions and 62 deletions
|
@ -337,6 +337,7 @@ module.exports = React.createClass({
|
|||
ref={this._collectEventNode.bind(this, eventId)}
|
||||
data-scroll-token={scrollToken}>
|
||||
<EventTile mxEvent={mxEv} continuation={continuation}
|
||||
onWidgetLoad={this._onWidgetLoad}
|
||||
last={last} isSelectedEvent={highlight} />
|
||||
</li>
|
||||
);
|
||||
|
@ -398,6 +399,15 @@ module.exports = React.createClass({
|
|||
this.eventNodes[eventId] = node;
|
||||
},
|
||||
|
||||
// once dynamic content in the events load, make the scrollPanel check the
|
||||
// scroll offsets.
|
||||
_onWidgetLoad: function() {
|
||||
var scrollPanel = this.refs.scrollPanel;
|
||||
if (scrollPanel) {
|
||||
scrollPanel.forceUpdate();
|
||||
}
|
||||
},
|
||||
|
||||
onResize: function() {
|
||||
dis.dispatch({ action: 'timeline_resize' }, true);
|
||||
},
|
||||
|
|
|
@ -798,9 +798,9 @@ module.exports = React.createClass({
|
|||
}
|
||||
}
|
||||
|
||||
// once images in the search results load, make the scrollPanel check
|
||||
// once dynamic content in the search results load, make the scrollPanel check
|
||||
// the scroll offsets.
|
||||
var onImageLoad = () => {
|
||||
var onWidgetLoad = () => {
|
||||
var scrollPanel = this.refs.searchResultsPanel;
|
||||
if (scrollPanel) {
|
||||
scrollPanel.checkScroll();
|
||||
|
@ -844,7 +844,7 @@ module.exports = React.createClass({
|
|||
searchResult={result}
|
||||
searchHighlights={this.state.searchHighlights}
|
||||
resultLink={resultLink}
|
||||
onImageLoad={onImageLoad}/>);
|
||||
onWidgetLoad={onWidgetLoad}/>);
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue