From 0477ac39166d3d509dce3edfb578c0018225706a Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Sat, 6 Dec 2014 14:45:18 -0600 Subject: [PATCH] Added transition to dialog overlay --- src/js/dialog.jsx | 7 ++++--- src/less/components/dialog.less | 29 +++++++++++------------------ 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/js/dialog.jsx b/src/js/dialog.jsx index 7f722a66029493..bcd5ffb8ef1f41 100644 --- a/src/js/dialog.jsx +++ b/src/js/dialog.jsx @@ -3,6 +3,7 @@ var React = require('react'), Events = require('./utils/events.js'), KeyCode = require('./utils/key-code.js'), Classable = require('./mixins/classable'), + Overlay = require('./overlay.jsx'), Paper = require('./paper.jsx'); var Dialog = React.createClass({ @@ -50,7 +51,7 @@ var Dialog = React.createClass({ return (
- +

{this.props.title}

@@ -63,7 +64,7 @@ var Dialog = React.createClass({
-
+ ); }, @@ -86,7 +87,7 @@ var Dialog = React.createClass({ el.style.marginTop = -1 * height / 2 + 'px'; }, - _handleClickAway: function() { + _handleOverlayTouchTap: function() { this.dismiss(); }, diff --git a/src/less/components/dialog.less b/src/less/components/dialog.less index 91e278b1dc7977..98a9f868151cf7 100644 --- a/src/less/components/dialog.less +++ b/src/less/components/dialog.less @@ -4,24 +4,31 @@ top: 50%; left: 50%; font-size: medium; - visibility: hidden; + - .mui-paper { + .dialog-window { position: relative; left: -50%; z-index: 2000; background: white; + visibility: hidden; } + &.show { - visibility: visible; + .dialog-window { + visibility: visible; + } } + .dialog-title { padding: 24px 24px 0 24px; margin-bottom: 0; } + .dialog-content { padding: 24px; } + .dialog-actions { width: 100%; padding: 8px 24px 16px 24px; @@ -41,18 +48,4 @@ cursor: pointer; } } -} - -.dialog-overlay { - position: fixed; - width: 100%; - height: 100%; - visibility: hidden; - top: 0; - left: 0; - background-color: rgba(0, 0, 0, 0.5); -} - -.dialog.show .dialog-overlay { - visibility: visible; -} +} \ No newline at end of file