2010-09-17 20:24:12 +00:00
|
|
|
/*
|
|
|
|
|
* jQuery Mobile Framework : prototype for "dialog" plugin.
|
|
|
|
|
* Copyright (c) jQuery Project
|
|
|
|
|
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
|
|
|
|
|
* Note: Code is in draft form and is subject to change
|
|
|
|
|
*/
|
2010-10-21 20:29:05 +00:00
|
|
|
(function ( $ ) {
|
|
|
|
|
$.widget( "mobile.dialog", $.mobile.widget, {
|
|
|
|
|
options: {},
|
|
|
|
|
_create: function(){
|
|
|
|
|
var $el = this.element,
|
|
|
|
|
$closeBtn = $('<a href="#" data-icon="delete" data-iconpos="notext">Close</a>')
|
|
|
|
|
.click(function(){
|
|
|
|
|
$.changePage([$el, $.activePage], undefined, true );
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.element
|
|
|
|
|
.bind("pageshow",function(){
|
|
|
|
|
return false;
|
|
|
|
|
})
|
2010-10-11 01:17:49 +00:00
|
|
|
//add ARIA role
|
|
|
|
|
.attr("role","dialog")
|
2010-10-07 21:32:45 +00:00
|
|
|
.addClass('ui-page ui-dialog ui-body-a')
|
2010-10-06 05:10:30 +00:00
|
|
|
.find('[data-role=header]')
|
2010-09-17 20:24:12 +00:00
|
|
|
.addClass('ui-corner-top ui-overlay-shadow')
|
2010-10-21 20:29:05 +00:00
|
|
|
.prepend( $closeBtn )
|
2010-09-17 20:55:30 +00:00
|
|
|
.end()
|
2010-10-06 05:10:30 +00:00
|
|
|
.find('.ui-content,[data-role=footer]')
|
2010-09-17 20:55:30 +00:00
|
|
|
.last()
|
|
|
|
|
.addClass('ui-corner-bottom ui-overlay-shadow');
|
2010-10-21 20:29:05 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})( jQuery );
|