Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling with the main log in view #817

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions src/platform/web/ui/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ body.hydrogen {
overscroll-behavior: none;
/* disable rubberband scrolling on document in IE11 */
overflow: hidden;
height: 100%;
width: 100%;
}

.hydrogen {
Expand Down
39 changes: 39 additions & 0 deletions src/platform/web/ui/css/themes/element/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,45 @@ a.button-action {

.PreSessionScreen {
padding: 30px;
max-height: calc(100% - 30px); /* removing padding */
display: flex;
overflow: auto;
flex-direction: column;
}

@media screen and (min-width: 600px) {
.PreSessionScreen {
max-height: calc(100% - 30px - 80px); /* removing padding and margin */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an idea, but would this be simpler if we use box-sizing: content-box?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ^^'

Copy link
Contributor Author

@Kaki-In Kaki-In Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't work because of the margin, I still need to had the @media.

}
}

.PreSessionScreen > * {
flex: 1 0 auto;
}

.PreSessionScreen > div {
flex: 1 1 auto;
}

.PreSessionScreen > div.logo {
flex: 1 0 auto;
}

.SessionPickerView {
display: flex;
flex-direction: column;
overflow: clip;
}

.SessionPickerView > * {
flex: 1 0 auto;
display: block;
position: relative;
}

.SessionPickerView ul {
flex: 1 1 auto;
overflow: auto;
}

.PreSessionScreen h1 {
Expand Down
56 changes: 29 additions & 27 deletions src/platform/web/ui/login/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,35 @@ export class LoginView extends TemplateView {
disabled
}),
t.div({className: "logo"}),
t.h1([vm.i18n`Sign In`]),
t.mapView(vm => vm.completeSSOLoginViewModel, vm => vm ? new CompleteSSOView(vm) : null),
t.if(vm => vm.showHomeserver, (t, vm) => t.div({ className: "LoginView_sso form-row text" },
[
t.label({for: "homeserver"}, vm.i18n`Homeserver`),
t.input({
id: "homeserver",
type: "text",
placeholder: vm.i18n`Your matrix homeserver`,
value: vm.homeserver,
disabled,
onInput: event => vm.setHomeserver(event.target.value),
onChange: () => vm.queryHomeserver(),
}),
t.p({className: {
LoginView_forwardInfo: true,
hidden: vm => !vm.resolvedHomeserver
}}, vm => vm.i18n`You will connect to ${vm.resolvedHomeserver}.`),
t.if(vm => vm.errorMessage, (t, vm) => t.p({className: "error"}, vm.i18n(vm.errorMessage))),
]
)),
t.if(vm => vm.isFetchingLoginOptions, t => t.div({className: "LoginView_query-spinner"}, [spinner(t), t.p("Fetching available login options...")])),
t.mapView(vm => vm.passwordLoginViewModel, vm => vm ? new PasswordLoginView(vm): null),
t.if(vm => vm.passwordLoginViewModel && vm.startSSOLoginViewModel, t => t.p({className: "LoginView_separator"}, vm.i18n`or`)),
t.mapView(vm => vm.startSSOLoginViewModel, vm => vm ? new StartSSOLoginView(vm) : null),
t.mapView(vm => vm.loadViewModel, loadViewModel => loadViewModel ? new SessionLoadStatusView(loadViewModel) : null),
// use t.mapView rather than t.if to create a new view when the view model changes too
t.div({className: "SessionLoginView"}, [
t.h1([vm.i18n`Sign In`]),
t.mapView(vm => vm.completeSSOLoginViewModel, vm => vm ? new CompleteSSOView(vm) : null),
t.if(vm => vm.showHomeserver, (t, vm) => t.div({ className: "LoginView_sso form-row text" },
[
t.label({for: "homeserver"}, vm.i18n`Homeserver`),
t.input({
id: "homeserver",
type: "text",
placeholder: vm.i18n`Your matrix homeserver`,
value: vm.homeserver,
disabled,
onInput: event => vm.setHomeserver(event.target.value),
onChange: () => vm.queryHomeserver(),
}),
t.p({className: {
LoginView_forwardInfo: true,
hidden: vm => !vm.resolvedHomeserver
}}, vm => vm.i18n`You will connect to ${vm.resolvedHomeserver}.`),
t.if(vm => vm.errorMessage, (t, vm) => t.p({className: "error"}, vm.i18n(vm.errorMessage))),
]
)),
t.if(vm => vm.isFetchingLoginOptions, t => t.div({className: "LoginView_query-spinner"}, [spinner(t), t.p("Fetching available login options...")])),
t.mapView(vm => vm.passwordLoginViewModel, vm => vm ? new PasswordLoginView(vm): null),
t.if(vm => vm.passwordLoginViewModel && vm.startSSOLoginViewModel, t => t.p({className: "LoginView_separator"}, vm.i18n`or`)),
t.mapView(vm => vm.startSSOLoginViewModel, vm => vm ? new StartSSOLoginView(vm) : null),
t.mapView(vm => vm.loadViewModel, loadViewModel => loadViewModel ? new SessionLoadStatusView(loadViewModel) : null),
// use t.mapView rather than t.if to create a new view when the view model changes too
]),
t.p(hydrogenGithubLink(t))
]);
}
Expand Down