Partial dialog refactor, in progress.

This commit is contained in:
Mat Marquis 2011-11-29 17:53:21 -05:00 committed by scottjehl
parent 5523c3c1ab
commit 5cbcc55ef9
2 changed files with 16 additions and 12 deletions

View file

@ -1,11 +1,11 @@
.ui-dialog { min-height: 480px; }
.ui-dialog { width: 80%; max-width: 500px; margin: 10% auto 15px auto; }
.ui-dialog .ui-header,
.ui-dialog .ui-content,
.ui-dialog .ui-footer {
max-width: 500px;
margin: 10% auto 15px auto;
width: 85%;
display: block;
position: relative;
width: auto;
}
.ui-dialog .ui-header,
.ui-dialog .ui-footer {

View file

@ -13,21 +13,25 @@ $.widget( "mobile.dialog", $.mobile.widget, {
_create: function() {
var self = this,
$el = this.element,
headerCloseButton = $( "<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "iconpos='notext'>"+ this.options.closeBtnText + "</a>" );
headerCloseButton = $( "<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "iconpos='notext'>"+ this.options.closeBtnText + "</a>" ),
dialogWrap = $("<div/>", {
"role" : "dialog",
"class" : "ui-dialog ui-corner-all ui-overlay-shadow"
});
$el.addClass( "ui-overlay-" + this.options.overlayTheme );
// Class the markup for dialog styling
// Set aria role
$el.attr( "role", "dialog" )
.addClass( "ui-dialog" )
$el
.wrapInner( dialogWrap )
.find( ":jqmData(role='header')" )
.addClass( "ui-corner-top ui-overlay-shadow" )
.prepend( headerCloseButton )
.end()
.find( ":jqmData(role='content'),:jqmData(role='footer')" )
.addClass( "ui-overlay-shadow" )
.last()
.find(':first-child')
.addClass( "ui-corner-top" )
.end()
.find( ":last-child" )
.addClass( "ui-corner-bottom" );
// this must be an anonymous function so that select menu dialogs can replace