mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-4343 Fixes for mobile main menu (#4148)
* Fixed mobile app link in the main menu to be displayed on mobile browsers * Fixed doubled up dividers in mobile menu * Added scrolling to mobile main menu
This commit is contained in:
@@ -30,7 +30,7 @@ export function executeCommand(channelId, message, suggest, success, error) {
|
||||
msg = msg.substring(0, msg.indexOf(' ')).toLowerCase() + msg.substring(msg.indexOf(' '), msg.length);
|
||||
|
||||
if (message.indexOf('/shortcuts') !== -1) {
|
||||
if (UserAgent.isMobileApp()) {
|
||||
if (UserAgent.isMobile()) {
|
||||
const err = {message: Utils.localizeMessage('create_post.shortcutsNotSupported', 'Keyboard shortcuts are not supported on your device')};
|
||||
error(err);
|
||||
return;
|
||||
|
||||
@@ -169,7 +169,7 @@ export default class CreateComment extends React.Component {
|
||||
}
|
||||
|
||||
commentMsgKeyPress(e) {
|
||||
if (!UserAgent.isMobileApp() && ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend)) {
|
||||
if (!UserAgent.isMobile() && ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend)) {
|
||||
if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
|
||||
e.preventDefault();
|
||||
ReactDOM.findDOMNode(this.refs.textbox).blur();
|
||||
|
||||
@@ -199,7 +199,7 @@ export default class CreatePost extends React.Component {
|
||||
}
|
||||
|
||||
postMsgKeyPress(e) {
|
||||
if (!UserAgent.isMobileApp() && ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend)) {
|
||||
if (!UserAgent.isMobile() && ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend)) {
|
||||
if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
|
||||
e.preventDefault();
|
||||
ReactDOM.findDOMNode(this.refs.textbox).blur();
|
||||
|
||||
@@ -95,7 +95,7 @@ export default class EditPostModal extends React.Component {
|
||||
}
|
||||
|
||||
handleEditKeyPress(e) {
|
||||
if (!UserAgent.isMobileApp() && !this.state.ctrlSend && e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
|
||||
if (!UserAgent.isMobile() && !this.state.ctrlSend && e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) {
|
||||
e.preventDefault();
|
||||
ReactDOM.findDOMNode(this.refs.editbox).blur();
|
||||
this.handleEdit();
|
||||
|
||||
@@ -37,7 +37,7 @@ export default class FilteredChannelList extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
// only focus the search box on desktop so that we don't cause the keyboard to open on mobile
|
||||
if (!UserAgent.isMobileApp()) {
|
||||
if (!UserAgent.isMobile()) {
|
||||
ReactDOM.findDOMNode(this.refs.filter).focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class FilteredUserList extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
// only focus the search box on desktop so that we don't cause the keyboard to open on mobile
|
||||
if (!UserAgent.isMobileApp()) {
|
||||
if (!UserAgent.isMobile()) {
|
||||
ReactDOM.findDOMNode(this.refs.filter).focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,6 +221,10 @@
|
||||
.divider {
|
||||
border-top: 1px solid transparent;
|
||||
margin: 0.5em 0;
|
||||
|
||||
& + .divider {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.team__header {
|
||||
@@ -302,10 +306,6 @@
|
||||
.admin-navbar-dropdown__icon {
|
||||
fill: $white;
|
||||
}
|
||||
|
||||
.divider + .divider {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.user__picture {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
border-right: $border-gray;
|
||||
display: none;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
padding: 0 0 2em;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
||||
@@ -911,7 +911,7 @@ export function getSuggestedCommands(command, suggestionId, component) {
|
||||
(data) => {
|
||||
var matches = [];
|
||||
data.forEach((cmd) => {
|
||||
if (cmd.trigger !== 'shortcuts' || !UserAgent.isMobileApp()) {
|
||||
if (cmd.trigger !== 'shortcuts' || !UserAgent.isMobile()) {
|
||||
if (('/' + cmd.trigger).indexOf(command) === 0) {
|
||||
const s = '/' + cmd.trigger;
|
||||
let hint = '';
|
||||
|
||||
@@ -77,8 +77,15 @@ export function isAndroidWeb() {
|
||||
return isAndroidChrome();
|
||||
}
|
||||
|
||||
// Returns true if and only if the user is using a Mattermost mobile app. This will return false if the user is using the
|
||||
// web browser on a mobile device.
|
||||
export function isMobileApp() {
|
||||
return isAndroid() || isIos();
|
||||
return userAgent.indexOf('iPhone') !== -1 && userAgent.indexOf('Safari') === -1 && userAgent.indexOf('CriOS') === -1;
|
||||
}
|
||||
|
||||
// Returns true if and only if the user is using Mattermost from either the mobile app or the web browser on a mobile device.
|
||||
export function isMobile() {
|
||||
return isIos() || isAndroid();
|
||||
}
|
||||
|
||||
export function isFirefox() {
|
||||
|
||||
Reference in New Issue
Block a user