mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
UX: on mobile devices iOS or Android always use full screen login
This simplifies life for users and embedded browsers and works around all popup blocking. There is no point to popup tabs on Android or iOS, it just causes confusion.
This commit is contained in:
parent
6075debc90
commit
58322617ec
3 changed files with 13 additions and 3 deletions
|
@ -176,7 +176,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
|
||||
authMessage: (function() {
|
||||
if (Ember.isEmpty(this.get('authenticate'))) return "";
|
||||
const method = findAll(this.siteSettings).findProperty("name", this.get("authenticate"));
|
||||
const method = findAll(this.siteSettings, this.capabilities, this.isMobileDevice).findProperty("name", this.get("authenticate"));
|
||||
if(method){
|
||||
return method.get('message');
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ const LoginMethod = Ember.Object.extend({
|
|||
let methods;
|
||||
let preRegister;
|
||||
|
||||
export function findAll(siteSettings) {
|
||||
export function findAll(siteSettings, capabilities, isMobileDevice) {
|
||||
if (methods) { return methods; }
|
||||
|
||||
methods = [];
|
||||
|
@ -55,6 +55,12 @@ export function findAll(siteSettings) {
|
|||
});
|
||||
preRegister = undefined;
|
||||
}
|
||||
|
||||
// On Mobile, Android or iOS always go with full screen
|
||||
if (isMobileDevice || capabilities.isIOS || capabilities.isAndroid) {
|
||||
methods.forEach(m=>m.set("fullScreenLogin", true));
|
||||
}
|
||||
|
||||
return methods;
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,11 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, {
|
|||
},
|
||||
|
||||
_autoLogin(modal, modalClass, notAuto) {
|
||||
const methods = findAll(this.siteSettings);
|
||||
|
||||
const methods = findAll(this.siteSettings,
|
||||
this.container.lookup('capabilities:main'),
|
||||
this.site.isMobileDevice);
|
||||
|
||||
if (!this.siteSettings.enable_local_logins && methods.length === 1) {
|
||||
this.controllerFor('login').send('externalLogin', methods[0]);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue