2010-10-15 01:56:51 +00:00
|
|
|
//set up the theme switcher on the homepage
|
2010-10-20 16:09:03 +00:00
|
|
|
$('div').live('pagecreate',function(event){
|
2010-11-04 22:50:43 +00:00
|
|
|
if( !$(this).is('.ui-dialog')){
|
2011-06-20 13:34:31 +00:00
|
|
|
var appendEl = $(this).find('.ui-footer:last');
|
2011-06-20 01:58:12 +00:00
|
|
|
|
|
|
|
|
if( !appendEl.length ){
|
|
|
|
|
appendEl = $(this).find('.ui-content');
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-20 22:23:09 +00:00
|
|
|
if( appendEl.is("[data-position]") ){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-20 18:46:23 +00:00
|
|
|
$('<a href="#themeswitcher" data-'+ $.mobile.ns +'rel="dialog" data-'+ $.mobile.ns +'transition="pop">Switch theme</a>')
|
2010-10-15 22:03:17 +00:00
|
|
|
.buttonMarkup({
|
|
|
|
|
'icon':'gear',
|
|
|
|
|
'inline': true,
|
|
|
|
|
'shadow': false,
|
|
|
|
|
'theme': 'd'
|
|
|
|
|
})
|
2011-06-20 01:58:12 +00:00
|
|
|
.appendTo( appendEl )
|
2010-10-15 22:03:17 +00:00
|
|
|
.wrap('<div class="jqm-themeswitcher">')
|
2011-06-20 13:34:31 +00:00
|
|
|
.bind( "vclick", function(){
|
2010-10-15 22:03:17 +00:00
|
|
|
$.themeswitcher();
|
|
|
|
|
});
|
|
|
|
|
}
|
2011-06-20 22:23:09 +00:00
|
|
|
|
2011-06-20 01:58:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//collapse page navs after use
|
|
|
|
|
$(function(){
|
2011-08-03 17:41:12 +00:00
|
|
|
$('body').delegate('.content-secondary .ui-collapsible-content', 'click', function(){
|
2011-06-20 01:58:12 +00:00
|
|
|
$(this).trigger("collapse")
|
|
|
|
|
});
|
2011-06-20 19:17:05 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function setDefaultTransition(){
|
2011-06-20 22:23:09 +00:00
|
|
|
var winwidth = $( window ).width(),
|
|
|
|
|
trans ="slide";
|
|
|
|
|
|
|
|
|
|
if( winwidth >= 1000 ){
|
|
|
|
|
trans = "none";
|
|
|
|
|
}
|
|
|
|
|
else if( winwidth >= 650 ){
|
|
|
|
|
trans = "fade";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$.mobile.defaultPageTransition = trans;
|
2011-06-20 19:17:05 +00:00
|
|
|
}
|
|
|
|
|
|
2011-08-02 22:22:55 +00:00
|
|
|
|
2011-06-20 19:17:05 +00:00
|
|
|
$(function(){
|
2011-08-02 22:22:55 +00:00
|
|
|
setDefaultTransition();
|
2011-06-20 19:17:05 +00:00
|
|
|
$( window ).bind( "throttledresize", setDefaultTransition );
|
2010-10-15 01:56:51 +00:00
|
|
|
});
|