From 29efeff09532397a33bb971e91324f673b296559 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Sat, 12 Nov 2016 00:54:53 +0500 Subject: PLT-4609 - Fixing list modals on mobile (#4536) * PLT-4609 - Fixing list modals on mobile * PLT-4609 - Adjust more modal height --- webapp/components/channel_invite_modal.jsx | 6 ----- webapp/components/channel_members_modal.jsx | 7 ----- webapp/components/member_list_team.jsx | 2 -- webapp/components/more_channels.jsx | 10 +------ webapp/components/more_direct_channels.jsx | 7 ----- webapp/components/searchable_user_list.jsx | 6 +---- webapp/components/team_members_modal.jsx | 7 ----- webapp/sass/components/_modal.scss | 42 ++++++++++++++++++++--------- webapp/sass/responsive/_mobile.scss | 30 +++++++++++++++++++-- 9 files changed, 59 insertions(+), 58 deletions(-) diff --git a/webapp/components/channel_invite_modal.jsx b/webapp/components/channel_invite_modal.jsx index 89185435a..cffc73705 100644 --- a/webapp/components/channel_invite_modal.jsx +++ b/webapp/components/channel_invite_modal.jsx @@ -11,7 +11,6 @@ import TeamStore from 'stores/team_store.jsx'; import {searchUsers} from 'actions/user_actions.jsx'; -import * as Utils from 'utils/utils.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import React from 'react'; @@ -133,13 +132,8 @@ export default class ChannelInviteModal extends React.Component { if (this.state.loading) { content = (); } else { - let maxHeight = 1000; - if (Utils.windowHeight() <= 1200) { - maxHeight = Utils.windowHeight() - 300; - } content = ( ); } else { - let maxHeight = 1000; - if (Utils.windowHeight() <= 1200) { - maxHeight = Utils.windowHeight() - 300; - } - let removeButton = null; if (this.props.isAdmin) { removeButton = [this.createRemoveMemberButton]; @@ -156,7 +150,6 @@ export default class ChannelMembersModal extends React.Component { content = ( ; @@ -204,10 +199,7 @@ export default class MoreChannels extends React.Component { onModalDismissed={() => this.setState({showNewChannelModal: false})} /> -
+
{moreChannels} {serverError}
diff --git a/webapp/components/more_direct_channels.jsx b/webapp/components/more_direct_channels.jsx index 4cb7db28a..50ab5224a 100644 --- a/webapp/components/more_direct_channels.jsx +++ b/webapp/components/more_direct_channels.jsx @@ -12,7 +12,6 @@ import TeamStore from 'stores/team_store.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import * as UserAgent from 'utils/user_agent.jsx'; -import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; import React from 'react'; @@ -185,11 +184,6 @@ export default class MoreDirectChannels extends React.Component { } render() { - let maxHeight = 1000; - if (Utils.windowHeight() <= 1200) { - maxHeight = Utils.windowHeight() - 300; - } - let teamToggle; if (global.window.mm_config.RestrictDirectMessage === 'any') { teamToggle = ( @@ -245,7 +239,6 @@ export default class MoreDirectChannels extends React.Component { {teamToggle} +
diff --git a/webapp/sass/components/_modal.scss b/webapp/sass/components/_modal.scss index 3faf78bc6..f89fb5c40 100644 --- a/webapp/sass/components/_modal.scss +++ b/webapp/sass/components/_modal.scss @@ -125,6 +125,7 @@ } .modal-dialog { + margin-bottom: 0; margin-left: auto; margin-right: auto; max-width: 95%; @@ -237,19 +238,6 @@ top: 0; } - &.more-channel__modal { - .modal-body { - overflow-x: hidden; - padding: 10px 0 15px; - } - - .channel-count { - @include opacity(.8); - float: right; - margin-top: 5px; - } - } - .modal-image { height: 100%; margin: 0 auto; @@ -449,9 +437,37 @@ } } } + + &.more-channel__modal { + .modal-body { + overflow-x: hidden; + padding: 10px 0 15px; + } + + .channel-count { + @include opacity(.8); + float: right; + margin-top: 5px; + } + + .more-modal__list { + max-height: calc(100vh - 270px); + } + } } .more-modal { + .more-modal__list { + height: 100vh; + max-height: calc(100vh - 340px); + } + + &.more-direct-channels { + .more-modal__list { + max-height: calc(100vh - 325px); + } + } + .user-list { margin-top: 10px; overflow-x: hidden; diff --git a/webapp/sass/responsive/_mobile.scss b/webapp/sass/responsive/_mobile.scss index 8fff2853c..708fa4fca 100644 --- a/webapp/sass/responsive/_mobile.scss +++ b/webapp/sass/responsive/_mobile.scss @@ -9,8 +9,6 @@ } .filtered-user-list { - max-height: 65vh !important; - .filter-button { .btn { width: 100%; @@ -1314,7 +1312,34 @@ } .app__body { + .more-modal { + .modal-body { + padding-bottom: 5px; + } + + .more-modal__list { + max-height: calc(100vh - 260px); + } + + &.more-direct-channels { + .more-modal__list { + max-height: calc(100vh - 295px); + } + } + } + .modal { + &.more-channel__modal { + .more-modal__list { + max-height: calc(100vh - 250px); + } + + .modal-body { + padding-bottom: 35px; + } + + } + .settings-modal { &.display--content { .modal-body { @@ -1324,6 +1349,7 @@ .modal-body { max-height: 70%; + padding-bottom: 0; } .settings-table { -- cgit v1.2.3-1-g7c22