summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorFlorian Orben <florian.orben@gmail.com>2015-10-29 17:39:22 +0100
committerFlorian Orben <florian.orben@gmail.com>2015-10-29 17:44:10 +0100
commit7e70788c947af34e742b681aab2ecdcde63b7463 (patch)
treec787672874d4b1b47a06df18afe7cc48d3cdd39e /web
parentca04e3bbc3be78edd4ba7c9f051543499dcfa0f3 (diff)
downloadchat-7e70788c947af34e742b681aab2ecdcde63b7463.tar.gz
chat-7e70788c947af34e742b681aab2ecdcde63b7463.tar.bz2
chat-7e70788c947af34e742b681aab2ecdcde63b7463.zip
simplify check if ctrl+enter was pressed
Diffstat (limited to 'web')
-rw-r--r--web/react/components/edit_post_modal.jsx10
-rw-r--r--web/react/components/post_attachment.jsx69
2 files changed, 4 insertions, 75 deletions
diff --git a/web/react/components/edit_post_modal.jsx b/web/react/components/edit_post_modal.jsx
index 2629d6b25..2abb3f151 100644
--- a/web/react/components/edit_post_modal.jsx
+++ b/web/react/components/edit_post_modal.jsx
@@ -57,12 +57,10 @@ export default class EditPostModal extends React.Component {
this.setState({editText: editMessage});
}
handleEditKeyPress(e) {
- if (this.state.ctrlSend === 'true' && e.ctrlKey || this.state.ctrlSend === 'false') {
- if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
- e.preventDefault();
- ReactDOM.findDOMNode(this.refs.editbox).blur();
- this.handleEdit(e);
- }
+ if (this.state.ctrlSend === 'false' && e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
+ e.preventDefault();
+ ReactDOM.findDOMNode(this.refs.editbox).blur();
+ this.handleEdit(e);
}
}
handleUserInput(e) {
diff --git a/web/react/components/post_attachment.jsx b/web/react/components/post_attachment.jsx
deleted file mode 100644
index d92637749..000000000
--- a/web/react/components/post_attachment.jsx
+++ /dev/null
@@ -1,69 +0,0 @@
-export default class PostAttachment extends React.Component {
- constructor(props) {
- super(props);
- }
-
- render() {
- return (
- <div>
- {'Pre text'}
- <div style={{border: '1px solid #CCC', borderRadius: 4, padding: '2px 5px', margin: '5px 0'}}>
- <div
- style={{borderLeft: '4px solid #F35A00', padding: '2px 0 2px 10px'}}
- >
- <strong>
- <img
- className='post-profile-img'
- src='http://cdn.sr-vice.de/images/misc/jenkins.png'
- height='14'
- width='14'
- style={{borderRadius: 50, marginRight: 5}}
- />
- {'@testuser'}
- </strong>
- <h1 style={{margin: '5px 0', padding: 0, lineHeight: '16px', fontSize: 16}}>
- <a
- href='#'
- style={{fontSize: 16}}
- >
- {'Attachment title'}
- </a>
- </h1>
- <div>
- <div style={{float: 'left', width: 485, paddingRight: 5}}>
- <p>
- {'This is the main text in a message attachment, and can contain standard message markup (see details below).'}
- </p>
- <img
- src='https://api.slack.com/img/api/attachment_image.png'
- style={{maxWidth: '100%', display: 'none'}}
- />
- <table style={{width: '100%'}}>
- <thead>
- <tr>
- <th>{'Assigned to'}</th>
- <th>{'Priority'}</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{'Paul'}</td>
- <td>{'Critical'}</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div style={{width: 75, float: 'right'}}>
- <img
- src='http://www.paulirish.com/wp-content/uploads/2009/02/f811e8ead5d62dfa20b55803cd7908b0.png'
- style={{height: 75}}
- />
- </div>
- <div style={{clear: 'both'}}></div>
- </div>
- </div>
- </div>
- </div>
- );
- }
-} \ No newline at end of file