mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Removed themeswitcher in docs.
This commit is contained in:
parent
86f74cbe39
commit
071b65f00d
2 changed files with 0 additions and 64 deletions
|
|
@ -1,33 +1,6 @@
|
|||
//set up the theme switcher on the homepage
|
||||
|
||||
define( [ "jquery.mobile" ], function() {
|
||||
$('div').live('pagecreate',function(event){
|
||||
if( !$(this).is('.ui-dialog')){
|
||||
var appendEl = $(this).find('.ui-footer:last');
|
||||
|
||||
if( !appendEl.length ){
|
||||
appendEl = $(this).find('.ui-content');
|
||||
}
|
||||
|
||||
if( appendEl.is("[data-position]") ){
|
||||
return;
|
||||
}
|
||||
|
||||
$('<a href="#themeswitcher" data-'+ $.mobile.ns +'rel="dialog" data-'+ $.mobile.ns +'transition="pop">Switch theme</a>')
|
||||
.buttonMarkup({
|
||||
'icon':'gear',
|
||||
'inline': true,
|
||||
'shadow': false,
|
||||
'theme': 'd'
|
||||
})
|
||||
.appendTo( appendEl )
|
||||
.wrap('<div class="jqm-themeswitcher">')
|
||||
.bind( "vclick", function(){
|
||||
$.themeswitcher();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//collapse page navs after use
|
||||
$(function(){
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
//quick & dirty theme switcher, written to potentially work as a bookmarklet
|
||||
(function($){
|
||||
$.themeswitcher = function(){
|
||||
if( $('[data-'+ $.mobile.ns +'-url=themeswitcher]').length ){ return; }
|
||||
var themesDir = 'http://jquerymobile.com/test/css/themes/',
|
||||
themes = ['default','valencia'],
|
||||
currentPage = $.mobile.activePage,
|
||||
menuPage = $( '<div data-'+ $.mobile.ns +'url="themeswitcher" data-'+ $.mobile.ns +'role=\'dialog\' data-'+ $.mobile.ns +'theme=\'a\'>' +
|
||||
'<div data-'+ $.mobile.ns +'role=\'header\' data-'+ $.mobile.ns +'theme=\'b\'>' +
|
||||
'<div class=\'ui-title\'>Switch Theme:</div>'+
|
||||
'</div>'+
|
||||
'<div data-'+ $.mobile.ns +'role=\'content\' data-'+ $.mobile.ns +'theme=\'c\'><ul data-'+ $.mobile.ns +'role=\'listview\' data-'+ $.mobile.ns +'inset=\'true\'></ul></div>'+
|
||||
'</div>' )
|
||||
.appendTo( $.mobile.pageContainer ),
|
||||
menu = menuPage.find('ul');
|
||||
|
||||
//menu items
|
||||
$.each(themes, function( i ){
|
||||
$('<li><a href="#" data-'+ $.mobile.ns +'rel="back">' + themes[ i ].charAt(0).toUpperCase() + themes[ i ].substr(1) + '</a></li>')
|
||||
.bind("vclick", function(){
|
||||
addTheme( themes[i] );
|
||||
menuPage.dialog( "close" );
|
||||
return false;
|
||||
})
|
||||
.appendTo(menu);
|
||||
});
|
||||
|
||||
//remover, adder
|
||||
function addTheme(theme){
|
||||
$('head').append( '<link rel=\'stylesheet\' href=\''+ themesDir + theme +'/\' />' );
|
||||
}
|
||||
|
||||
//create page, listview
|
||||
menuPage.page();
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue