Fix: was using bad params and not complete.

This commit is contained in:
Laurent Destailleur 2013-05-31 20:09:26 +02:00
parent 06fc0eec5b
commit b4c4211b98

View File

@ -1148,20 +1148,22 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
// jQuery jMobile
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0))
{
// We must force not using ajax because cache of jquery does not load js of other pages.
// This also increase seriously speed onto mobile device where complex js code is very slow and memory very low.
// Note: We can force not using ajax because cache of jquery does not load js of other pages by setting ajaxEnabled.
if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 2)
{
print '<script type="text/javascript">
$(document).bind("mobileinit", function(){
$.extend( $.mobile , {
ajaxFormsEnabled : false,
ajaxLinksEnabled : false, /* old param */
ajaxEnabled : false /* new param */
});
});
</script>';
}
print '<script type="text/javascript">
$(document).bind("mobileinit", function(){
$.extend( $.mobile , {
autoInitializePage : true, /* We need this to run jmobile */
/* loadingMessage : \'xxxxx\', */
touchOverflowEnabled : true,
defaultPageTransition : \'none\',
defaultDialogTransition : \'none\',
ajaxEnabled : false /* old param was ajaxFormsEnabled and ajaxLinksEnabled */
});
});
</script>';
}
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js"></script>'."\n";
}
}