Disable Ctrl+E modal in share and filepicker modals

pull/1/head
yflory 5 years ago
parent a125f6a764
commit 74372ba5d4

@ -505,7 +505,7 @@ define([
}; };
var shortcuts = []; var shortcuts = [];
funcs.addShortcuts = function (w) { funcs.addShortcuts = function (w, isApp) {
w = w || window; w = w || window;
if (shortcuts.indexOf(w) !== -1) { return; } if (shortcuts.indexOf(w) !== -1) { return; }
shortcuts.push(w); shortcuts.push(w);
@ -513,7 +513,7 @@ define([
// Ctrl || Meta (mac) // Ctrl || Meta (mac)
if (e.ctrlKey || (navigator.platform === "MacIntel" && e.metaKey)) { if (e.ctrlKey || (navigator.platform === "MacIntel" && e.metaKey)) {
// Ctrl+E: New pad modal // Ctrl+E: New pad modal
if (e.which === 69) { if (e.which === 69 && isApp) {
e.preventDefault(); e.preventDefault();
return void funcs.createNewPadModal(); return void funcs.createNewPadModal();
} }
@ -619,22 +619,24 @@ define([
ctx.metadataMgr.onReady(waitFor()); ctx.metadataMgr.onReady(waitFor());
funcs.addShortcuts();
}).nThen(function () { }).nThen(function () {
var privateData = ctx.metadataMgr.getPrivateData();
funcs.addShortcuts(window, Boolean(privateData.app));
try { try {
var feedback = ctx.metadataMgr.getPrivateData().feedbackAllowed; var feedback = privateData.feedbackAllowed;
Feedback.init(feedback); Feedback.init(feedback);
} catch (e) { Feedback.init(false); } } catch (e) { Feedback.init(false); }
try { try {
var forbidden = ctx.metadataMgr.getPrivateData().disabledApp; var forbidden = privateData.disabledApp;
if (forbidden) { if (forbidden) {
UI.alert(Messages.disabledApp, function () { UI.alert(Messages.disabledApp, function () {
funcs.gotoURL('/drive/'); funcs.gotoURL('/drive/');
}, {forefront: true}); }, {forefront: true});
return; return;
} }
var mustLogin = ctx.metadataMgr.getPrivateData().registeredOnly; var mustLogin = privateData.registeredOnly;
if (mustLogin) { if (mustLogin) {
UI.alert(Messages.mustLogin, function () { UI.alert(Messages.mustLogin, function () {
funcs.setLoginRedirect(function () { funcs.setLoginRedirect(function () {
@ -648,7 +650,7 @@ define([
} }
try { try {
window.CP_DEV_MODE = ctx.metadataMgr.getPrivateData().devMode; window.CP_DEV_MODE = privateData.devMode;
} catch (e) {} } catch (e) {}
ctx.sframeChan.on('EV_LOGOUT', function () { ctx.sframeChan.on('EV_LOGOUT', function () {
@ -658,7 +660,7 @@ define([
} }
}); });
UI.addLoadingScreen({hideTips: true}); UI.addLoadingScreen({hideTips: true});
var origin = ctx.metadataMgr.getPrivateData().origin; var origin = privateData.origin;
var href = origin + "/login/"; var href = origin + "/login/";
var onLogoutMsg = Messages._getKey('onLogout', ['<a href="' + href + '" target="_blank">', '</a>']); var onLogoutMsg = Messages._getKey('onLogout', ['<a href="' + href + '" target="_blank">', '</a>']);
UI.errorLoadingScreen(onLogoutMsg, true); UI.errorLoadingScreen(onLogoutMsg, true);

Loading…
Cancel
Save