From c2a0d8600f8d127594008802e23403c7a13d1b2d Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 9 Jan 2018 21:06:47 +0100 Subject: [PATCH] Electron: Move prompt to top to avoid issue with date picker being hidden --- ElectronClient/app/app.js | 10 ---------- ElectronClient/app/gui/PromptDialog.jsx | 25 +++++-------------------- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/ElectronClient/app/app.js b/ElectronClient/app/app.js index ad3faef73..3dbedb922 100644 --- a/ElectronClient/app/app.js +++ b/ElectronClient/app/app.js @@ -171,16 +171,6 @@ class Application extends BaseApplication { { label: _('File'), submenu: [{ - // label: _('Save'), - // accelerator: 'CommandOrControl+S', - // screens: ['Main'], - // click: () => { - // this.dispatch({ - // type: 'WINDOW_COMMAND', - // name: 'save_ntoe', - // }); - // } - // }, { label: _('New note'), accelerator: 'CommandOrControl+N', screens: ['Main'], diff --git a/ElectronClient/app/gui/PromptDialog.jsx b/ElectronClient/app/gui/PromptDialog.jsx index 0ec82cff6..40061a0ae 100644 --- a/ElectronClient/app/gui/PromptDialog.jsx +++ b/ElectronClient/app/gui/PromptDialog.jsx @@ -42,17 +42,20 @@ class PromptDialog extends React.Component { this.styles_ = {}; + const paddingTop = 20; + this.styles_.modalLayer = { zIndex: 9999, position: 'absolute', top: 0, left: 0, width: width, - height: height, + height: height - paddingTop, backgroundColor: 'rgba(0,0,0,0.6)', display: visible ? 'flex' : 'none', - alignItems: 'center', + alignItems: 'flex-start', justifyContent: 'center', + paddingTop: paddingTop + 'px', }; this.styles_.promptDialog = { @@ -88,24 +91,6 @@ class PromptDialog extends React.Component { return this.styles_; } - // shouldComponentUpdate(nextProps, nextState) { - // console.info(JSON.stringify(nextProps)+JSON.stringify(nextState)); - - // console.info('NEXT PROPS ===================='); - // for (var n in nextProps) { - // if (!nextProps.hasOwnProperty(n)) continue; - // console.info(n + ' = ' + (nextProps[n] === this.props[n])); - // } - - // console.info('NEXT STATE ===================='); - // for (var n in nextState) { - // if (!nextState.hasOwnProperty(n)) continue; - // console.info(n + ' = ' + (nextState[n] === this.state[n])); - // } - - // return true; - // } - render() { const style = this.props.style; const theme = themeStyle(this.props.theme);