broken style when MessageBox overflow

This commit is contained in:
斟酌 鵬兄 2015-09-28 07:16:49 +08:00
parent c08786d801
commit c72651143b
3 changed files with 28 additions and 4 deletions

View File

@ -11,8 +11,10 @@
.mbox_body { .mbox_body {
min-width: 350px; min-width: 350px;
min-height: 100px; min-height: 100px;
max-width: 800px; max-width: 800px;
max-height: 600px; max-height: 600px;
position: absolute; position: absolute;
background-color: rgba( 0, 0, 0, 0.8 ); background-color: rgba( 0, 0, 0, 0.8 );
@ -34,6 +36,7 @@
font-family: sans-serif; font-family: sans-serif;
color: white; color: white;
overflow: hidden;
/* /*
-moz-box-shadow: inset 0 10px 10px -10px black; -moz-box-shadow: inset 0 10px 10px -10px black;
-webkit-box-shadow: inset 0 10px 10px -10px black; -webkit-box-shadow: inset 0 10px 10px -10px black;
@ -41,6 +44,13 @@
*/ */
} }
.mbox-inners {
/* This is to hide the scrollbar */
padding-right: 50%;
margin-right: -50%;
overflow-y: scroll;
}
.mbox_buttons { .mbox_buttons {
text-align: right; text-align: right;
padding: 1em 0.5em; padding: 1em 0.5em;

View File

@ -79,8 +79,8 @@
"mbox_body cubic500" "mbox_body cubic500"
, [ , [
Dand.wrapc( "mbox_titlebar flsf", title ) Dand.wrapc( "mbox_titlebar flsf", title )
, Dand.wrapc( "mbox_content", content ) , Dand.wrapc( "mbox_content", this.innerBox = Dand.wrapc( "mbox-inners", content ) )
, Dand.wrapc( "mbox_buttons", no ? [ _yes, _no ] : _yes ) , this.buttonBox = Dand.wrapc( "mbox_buttons", no ? [ _yes, _no ] : _yes )
] ]
) )
); );
@ -106,9 +106,21 @@
, function() , function()
{ {
m_style.transition = m_style.minHeight = m_style.height = m_style.overflow = ""; m_style.transition = m_style.minHeight = m_style.height = m_style.overflow = "";
m_style.marginTop = String( -0.5 * this.mbox.clientHeight ) + "px";
var bBox = this.buttonBox;
var mHeight = this.mbox.clientHeight;
var innerHeight = this.innerBox.clientHeight;
var bBoxHeight = bBox.clientHeight;
m_style.marginTop = ( -0.5 * mHeight ) + "px";
m_style.opacity = 1; m_style.opacity = 1;
if( mHeight < ( bBox.getBoundingClientRect().y - bBox.parentNode.getBoundingClientRect().y + bBoxHeight ) )
{
m_style.height = "100%";
this.innerBox.style.maxHeight = ( innerHeight - bBoxHeight ) + "px"
}
}.bind( this ) }.bind( this )
); );

View File

@ -2,7 +2,9 @@
var ns = __namespace( "System.Cycle.Trigger" ); var ns = __namespace( "System.Cycle.Trigger" );
/** @type {System.Cycle} */ /** @type {System.Cycle} */
var Cycle = __import( "System.Cycle" ); var Cycle = __import( "System.Cycle" );
/** @type {System.Debug} */
var debug = __import( "System.Debug" );
// trigger list // trigger list
var tList = []; var tList = [];