From 1c224fedc5b83aee622f9a92b573ff1d405012ed Mon Sep 17 00:00:00 2001 From: Dick Choi Date: Tue, 7 Jun 2016 10:48:41 +0900 Subject: [PATCH] hide scroll bar when modal shows up --- browser/lib/modal.js | 3 +++ browser/styles/main/index.styl | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/browser/lib/modal.js b/browser/lib/modal.js index 7e330178..6dcf0638 100644 --- a/browser/lib/modal.js +++ b/browser/lib/modal.js @@ -15,6 +15,7 @@ class ModalBase extends React.Component { close () { if (modalBase != null) modalBase.setState({component: null, componentProps: null, isHidden: true}) + document.body.setAttribute('data-modal', 'close') remote.getCurrentWebContents().send('list-focus') } @@ -37,6 +38,8 @@ let modalBase = ReactDOM.render(, el) export function openModal (component, props) { if (modalBase == null) { return } + + document.body.setAttribute('data-modal', 'open') modalBase.setState({component: component, componentProps: props, isHidden: false}) } diff --git a/browser/styles/main/index.styl b/browser/styles/main/index.styl index 434e91a5..1f737a84 100644 --- a/browser/styles/main/index.styl +++ b/browser/styles/main/index.styl @@ -23,6 +23,10 @@ body font-size fontSize font-weight 400 +body[data-modal="open"] + #content * + overflow hidden !important + button, input, select, textarea font-family DEFAULT_FONTS