Improve UI on mobile

pull/1/head
yflory 8 years ago
parent 5c8586f8a3
commit 5a21be8112

@ -388,6 +388,11 @@
right: 0; right: 0;
text-align: center; text-align: center;
} }
@media screen and (max-height: 600px) {
.cp #loadingTip {
display: none;
}
}
.cp #loadingTip span { .cp #loadingTip span {
background-color: #302B28; background-color: #302B28;
color: #fafafa; color: #fafafa;

@ -119,6 +119,8 @@ define([
}); });
$('button.login').click(function () { $('button.login').click(function () {
// setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up
window.setTimeout(function () {
Cryptpad.addLoadingScreen(Messages.login_hashing); Cryptpad.addLoadingScreen(Messages.login_hashing);
// We need a setTimeout(cb, 0) otherwise the loading screen is only displayed after hashing the password // We need a setTimeout(cb, 0) otherwise the loading screen is only displayed after hashing the password
window.setTimeout(function () { window.setTimeout(function () {
@ -167,6 +169,7 @@ define([
}); });
}); });
}, 0); }, 0);
}, 100);
}); });
/* End Log in UI */ /* End Log in UI */

@ -36,6 +36,9 @@
left: 0; left: 0;
right: 0; right: 0;
text-align: center; text-align: center;
@media screen and (max-height: @media-medium-screen) {
display: none;
}
span { span {
background-color: @bg-loading; background-color: @bg-loading;
color: @color-loading; color: @color-loading;

@ -770,6 +770,7 @@ define([
var displayMenu = function (e, $menu) { var displayMenu = function (e, $menu) {
$menu.css({ display: "block" }); $menu.css({ display: "block" });
if (APP.mobile()) { return; }
var h = $menu.outerHeight(); var h = $menu.outerHeight();
var w = $menu.outerWidth(); var w = $menu.outerWidth();
var wH = window.innerHeight; var wH = window.innerHeight;
@ -1792,7 +1793,7 @@ define([
module.resetTree(); module.resetTree();
// in history mode we want to focus the version number input // in history mode we want to focus the version number input
if (!history.isHistoryMode) { $tree.find('#searchInput').focus(); } if (!history.isHistoryMode && !APP.mobile()) { $tree.find('#searchInput').focus(); }
$tree.find('#searchInput')[0].selectionStart = getSearchCursor(); $tree.find('#searchInput')[0].selectionStart = getSearchCursor();
$tree.find('#searchInput')[0].selectionEnd = getSearchCursor(); $tree.find('#searchInput')[0].selectionEnd = getSearchCursor();
@ -2066,6 +2067,7 @@ define([
if (!filesOp.comparePath(newLocation, currentPath.slice())) { displayDirectory(newLocation); } if (!filesOp.comparePath(newLocation, currentPath.slice())) { displayDirectory(newLocation); }
return; return;
} }
if (APP.mobile()) { return; }
search.to = window.setTimeout(function () { search.to = window.setTimeout(function () {
if (!isInSearchTmp) { search.oldLocation = currentPath.slice(); } if (!isInSearchTmp) { search.oldLocation = currentPath.slice(); }
var newLocation = [SEARCH, $input.val()]; var newLocation = [SEARCH, $input.val()];

@ -57,6 +57,8 @@ define([
}); });
$('button.login').click(function () { $('button.login').click(function () {
// setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up
window.setTimeout(function () {
Cryptpad.addLoadingScreen(Messages.login_hashing); Cryptpad.addLoadingScreen(Messages.login_hashing);
// We need a setTimeout(cb, 0) otherwise the loading screen is only displayed after hashing the password // We need a setTimeout(cb, 0) otherwise the loading screen is only displayed after hashing the password
window.setTimeout(function () { window.setTimeout(function () {
@ -116,6 +118,7 @@ define([
}); });
}); });
}, 0); }, 0);
}, 100);
}); });
}); });
}); });

@ -101,7 +101,11 @@ define([
function (yes) { function (yes) {
if (!yes) { return; } if (!yes) { return; }
// setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up
window.setTimeout(function () {
Cryptpad.addLoadingScreen(Messages.login_hashing); Cryptpad.addLoadingScreen(Messages.login_hashing);
// We need a setTimeout(cb, 0) otherwise the loading screen is only displayed after hashing the password
window.setTimeout(function () {
Login.loginOrRegister(uname, passwd, true, function (err, result) { Login.loginOrRegister(uname, passwd, true, function (err, result) {
var proxy = result.proxy; var proxy = result.proxy;
@ -152,6 +156,8 @@ define([
logMeIn(result); logMeIn(result);
}); });
}, 0);
}, 100);
}, { }, {
ok: Messages.register_writtenPassword, ok: Messages.register_writtenPassword,
cancel: Messages.register_cancel, cancel: Messages.register_cancel,

Loading…
Cancel
Save