Ctrl+Enter sends messages in mobile view (#3833)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
388fefcc43
Коммит
efef3e8ee2
@@ -15,6 +15,7 @@ import MsgTyping from './msg_typing.jsx';
|
|||||||
import FileUpload from './file_upload.jsx';
|
import FileUpload from './file_upload.jsx';
|
||||||
import FilePreview from './file_preview.jsx';
|
import FilePreview from './file_preview.jsx';
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
|
import * as UserAgent from 'utils/user_agent.jsx';
|
||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
@@ -168,7 +169,7 @@ export default class CreateComment extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
commentMsgKeyPress(e) {
|
commentMsgKeyPress(e) {
|
||||||
if (!Utils.isMobile() && ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend)) {
|
if (!UserAgent.isMobileApp() && ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend)) {
|
||||||
if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
|
if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
ReactDOM.findDOMNode(this.refs.textbox).blur();
|
ReactDOM.findDOMNode(this.refs.textbox).blur();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
|
|||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||||
import Client from 'client/web_client.jsx';
|
import Client from 'client/web_client.jsx';
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
|
import * as UserAgent from 'utils/user_agent.jsx';
|
||||||
import * as ChannelActions from 'actions/channel_actions.jsx';
|
import * as ChannelActions from 'actions/channel_actions.jsx';
|
||||||
|
|
||||||
import ChannelStore from 'stores/channel_store.jsx';
|
import ChannelStore from 'stores/channel_store.jsx';
|
||||||
@@ -198,7 +199,7 @@ export default class CreatePost extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
postMsgKeyPress(e) {
|
postMsgKeyPress(e) {
|
||||||
if (!Utils.isMobile() && ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend)) {
|
if (!UserAgent.isMobileApp() && ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend)) {
|
||||||
if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
|
if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
ReactDOM.findDOMNode(this.refs.textbox).blur();
|
ReactDOM.findDOMNode(this.refs.textbox).blur();
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user