mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-21 14:44:44 +00:00
added a few lines to the $mobilize function to convert the roles of header/content/footer to classes.
updated ajaxform and globalnav to accommodate change
This commit is contained in:
parent
f253a64c01
commit
9e37d2c1e9
3 changed files with 8 additions and 3 deletions
|
|
@ -9,7 +9,7 @@
|
|||
//ajax response callbacks
|
||||
$.formhandlers = {
|
||||
'default' : function(data,type){
|
||||
return $(data).find('.ui-content:eq(0)');
|
||||
return $(data).find('[data-role="content"]:eq(0)');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ $.fn.ajaxform = function(options){
|
|||
dataFilter: o.dataFilter,
|
||||
success: function(data,textStatus){
|
||||
$('.ui-page-active .ui-content').replaceWith( data );
|
||||
$.mobilize($('.ui-page-active .ui-content'));
|
||||
$.mobilize( $('.ui-page-active [data-role="content"]') );
|
||||
$.pageLoading(true);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ $.fn.globalnav = function(settings){
|
|||
var moreId = o.thisId + "&" + jQuery.mobile.subPageUrlKey + "=globalnav",
|
||||
$navToggle = $('<a href="#'+ moreId +'" data-transition="slideup">' + o.moreText + '</a>'),
|
||||
$truncatedLis = $globalnav.find('li:gt(2)'),
|
||||
$newPage = $('<div id="'+ moreId +'" class="ui-page ui-globalnav-expanded ui-body-a"><div class="ui-header"><h1>' + o.moreText + '</h1></div><div class="ui-content"></div></div>'),
|
||||
$newPage = $('<div id="'+ moreId +'" class="ui-page ui-globalnav-expanded ui-body-a"><div data-role="header"><h1>' + o.moreText + '</h1></div><div data-role="content"></div></div>'),
|
||||
$newPageContent = $globalnav.find('ul').clone();
|
||||
|
||||
$newPageContent
|
||||
|
|
|
|||
|
|
@ -243,6 +243,11 @@
|
|||
if( !$el.closest('.ui-page').length ) {
|
||||
$el.addClass('ui-page');
|
||||
}
|
||||
//header,content,footer
|
||||
$el.find('[data-role="header"]').addClass('ui-header');
|
||||
$el.find('[data-role="content"]').addClass('ui-content');
|
||||
$el.find('[data-role="footer"]').addClass('ui-footer');
|
||||
$el.filter('[data-role="content"]').addClass('ui-content'); //for ajaxform response
|
||||
//dialog
|
||||
$el.filter('[data-role="dialog"]').dialog();
|
||||
//checkboxes, radios
|
||||
|
|
|
|||
Loading…
Reference in a new issue