Created
August 30, 2016 00:56
-
-
Save mzbac/5acf2575550505664f586a8763798fc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ModalFixMixin = { | |
componentDidMount() { | |
if (document && document.body) { | |
var orig = document.body.className; | |
document.body.className = orig + (orig ? ' ' : '') + 'modal-open'; | |
} | |
}, | |
componentWillUnmount() { | |
if (document && document.body) { | |
document.body.className = document.body.className.replace(/ ?modal-open/, ''); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment