diff options
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/channel_header.jsx | 7 | ||||
-rw-r--r-- | web/react/components/edit_channel_modal.jsx | 2 | ||||
-rw-r--r-- | web/react/components/get_link_modal.jsx | 2 | ||||
-rw-r--r-- | web/react/components/mention_list.jsx | 9 | ||||
-rw-r--r-- | web/react/components/msg_typing.jsx | 8 | ||||
-rw-r--r-- | web/react/components/new_channel.jsx | 2 | ||||
-rw-r--r-- | web/react/components/post_list.jsx | 2 | ||||
-rw-r--r-- | web/react/components/textbox.jsx | 4 | ||||
-rw-r--r-- | web/react/components/view_image.jsx | 2 |
9 files changed, 29 insertions, 9 deletions
diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx index 48cb4d13b..68de80228 100644 --- a/web/react/components/channel_header.jsx +++ b/web/react/components/channel_header.jsx @@ -4,6 +4,7 @@ var ChannelStore = require('../stores/channel_store.jsx'); var UserStore = require('../stores/user_store.jsx'); var PostStore = require('../stores/post_store.jsx'); +var SocketStore = require('../stores/socket_store.jsx') var UserProfile = require( './user_profile.jsx' ); var NavbarSearchBox =require('./search_bar.jsx'); var AsyncClient = require('../utils/async_client.jsx'); @@ -82,6 +83,7 @@ module.exports = React.createClass({ ChannelStore.addExtraInfoChangeListener(this._onChange); PostStore.addSearchChangeListener(this._onChange); UserStore.addChangeListener(this._onChange); + SocketStore.addChangeListener(this._onSocketChange); }, componentWillUnmount: function() { ChannelStore.removeChangeListener(this._onChange); @@ -96,6 +98,11 @@ module.exports = React.createClass({ } $(".channel-header__info .description").popover({placement : 'bottom', trigger: 'hover', html: true, delay: {show: 500, hide: 500}}); }, + _onSocketChange: function(msg) { + if(msg.action === "new_user") { + AsyncClient.getChannelExtraInfo(true); + } + }, getInitialState: function() { return getStateFromStores(); }, diff --git a/web/react/components/edit_channel_modal.jsx b/web/react/components/edit_channel_modal.jsx index f1f4eca40..255654fd5 100644 --- a/web/react/components/edit_channel_modal.jsx +++ b/web/react/components/edit_channel_modal.jsx @@ -43,7 +43,7 @@ module.exports = React.createClass({ <h4 className="modal-title" ref="title">Edit {this.state.title} Description</h4> </div> <div className="modal-body"> - <textarea className="form-control" rows="6" ref="channelDesc" maxLength="1024" value={this.state.description} onChange={this.handleUserInput}></textarea> + <textarea className="form-control" style={{resize: "none"}} rows="6" ref="channelDesc" maxLength="1024" value={this.state.description} onChange={this.handleUserInput}></textarea> </div> <div className="modal-footer"> <button type="button" className="btn btn-default" data-dismiss="modal">Close</button> diff --git a/web/react/components/get_link_modal.jsx b/web/react/components/get_link_modal.jsx index 69e565185..bbfdce63a 100644 --- a/web/react/components/get_link_modal.jsx +++ b/web/react/components/get_link_modal.jsx @@ -38,7 +38,7 @@ module.exports = React.createClass({ <div className="modal-body"> <p>{"The link below is used for open " + strings.TeamPlural + " or if you allowed your " + strings.Team + " members to sign up using their " + strings.Company + " email addresses."} </p> - <textarea className="form-control" readOnly="true" value={this.state.value}></textarea> + <textarea className="form-control" style={{resize: "none"}} readOnly="true" value={this.state.value}></textarea> </div> <div className="modal-footer"> <button type="button" className="btn btn-default" data-dismiss="modal">Close</button> diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx index 2fecc129a..3fac41073 100644 --- a/web/react/components/mention_list.jsx +++ b/web/react/components/mention_list.jsx @@ -14,7 +14,7 @@ module.exports = React.createClass({ PostStore.addMentionDataChangeListener(this._onChange); var self = this; - $('#'+this.props.id).on('keypress.mentionlist', + $('body').on('keypress.mentionlist', '#'+this.props.id, function(e) { if (!self.isEmpty() && self.state.mentionText != '-1' && e.which === 13) { e.stopPropagation(); @@ -23,15 +23,16 @@ module.exports = React.createClass({ } } ); - $(document).click(function() { - if($('#'+self.props.id).length && $('#'+self.props.id).get(0) !== $(':focus').get(0)) { + $(document).click(function(e) { + if (!($('#'+self.props.id).is(e.target) || $('#'+self.props.id).has(e.target).length || + ('mentionlist' in self.refs && $(self.refs['mentionlist'].getDOMNode()).has(e.target).length))) { self.setState({mentionText: "-1"}) } }); }, componentWillUnmount: function() { PostStore.removeMentionDataChangeListener(this._onChange); - $('#'+this.props.id).off('keypress.mentionlist'); + $('body').off('keypress.mentionlist', '#'+this.props.id); }, _onChange: function(id, mentionText, excludeList) { if (id !== this.props.id) return; diff --git a/web/react/components/msg_typing.jsx b/web/react/components/msg_typing.jsx index 9d3904757..a6953028f 100644 --- a/web/react/components/msg_typing.jsx +++ b/web/react/components/msg_typing.jsx @@ -11,6 +11,11 @@ module.exports = React.createClass({ componentDidMount: function() { SocketStore.addChangeListener(this._onChange); }, + componentWillReceiveProps: function(newProps) { + if(this.props.channelId !== newProps.channelId) { + this.setState({text:""}); + } + }, componentWillUnmount: function() { SocketStore.removeChangeListener(this._onChange); }, @@ -37,6 +42,9 @@ module.exports = React.createClass({ }, 3000); } } + else if (msg.action == "posted" && msg.channel_id === this.props.channelId) { + this.setState({text:""}) + } }, getInitialState: function() { return { text: "" }; diff --git a/web/react/components/new_channel.jsx b/web/react/components/new_channel.jsx index 13fa5b2cc..160241c1c 100644 --- a/web/react/components/new_channel.jsx +++ b/web/react/components/new_channel.jsx @@ -122,7 +122,7 @@ module.exports = React.createClass({ </div> <div className="form-group"> <label className='control-label'>Description</label> - <textarea className="form-control" ref="channel_desc" rows="3" placeholder="Description" maxLength="1024"></textarea> + <textarea className="form-control" style={{resize: "none"}} ref="channel_desc" rows="3" placeholder="Description" maxLength="1024"></textarea> </div> { server_error } </form> diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index 169efc766..fc5157ce6 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -123,7 +123,7 @@ module.exports = React.createClass({ $('.post-list__content div .post').removeClass('post--last'); $('.post-list__content div:last-child .post').addClass('post--last'); - $('body').on('mouseenter mouseleave', '.post', function(ev){ + $('body').on('mouseenter mouseleave', '.post:not(.post--comment.same--root)', function(ev){ if(ev.type === 'mouseenter'){ $(this).parent('div').prev('.date-separator, .new-separator').addClass('hovered--after'); $(this).parent('div').next('.date-separator, .new-separator').addClass('hovered--before'); diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx index 934e863a2..6b746aa78 100644 --- a/web/react/components/textbox.jsx +++ b/web/react/components/textbox.jsx @@ -78,6 +78,8 @@ module.exports = React.createClass({ var re = new RegExp('( |^)@' + m + '( |$|\n)', 'm'); html = html.replace(re, '$1<span class="mention">@'+m+'</span>$2'); } + var re2 = new RegExp('(^$)(?![.\n])', 'gm'); + html = html.replace(re2, '<br/><br/>'); $(this.refs.textdiv.getDOMNode()).html(html); }, handleChange: function() { @@ -262,6 +264,8 @@ module.exports = React.createClass({ $(d).css({'height':'auto','overflow-y':'scroll'}).height(167); $(w).css({'height':'auto'}).height(167); } + + $(d).scrollTop($(e).scrollTop()); }, handleFocus: function() { var elm = this.refs.message.getDOMNode(); diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index c573e9dbb..38f439946 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -161,7 +161,7 @@ module.exports = React.createClass({ <div className="image-links"> { config.AllowPublicLink ? <div> - <a href="#" className="text" data-title="Public Image" onClick={this.getPublicLink}>Get Public Link</a> + <a href="#" className="public-link text" data-title="Public Image" onClick={this.getPublicLink}>Get Public Link</a> <span className="text"> | </span> </div> : "" } |