You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

62 lines
1.0 KiB

// namespace
var shape = {
handler: {}
};
// ready event
shape.ready = function() {
// selector cache
var
$ui = $('.ui'),
$swap = $('.swap.button'),
$menu = $('.menu.button'),
$demo = $('.demo'),
// alias
handler
;
// event handlers
handler = {
swapStyle: function() {
$('head link')
.each(function() {
var
href = $(this).attr('href')
;
console.log (href, href.search('flat') );
if( href.search('flat') > -1 ) {
console.log('zz');
$(this).attr('href', href.replace('flat', 'shaded'));
}
else {
console.log('aaa');
$(this).attr('href', href.replace('shaded', 'flat'));
}
})
;
}
};
// attach events
$ui
.state()
;
$swap
.on('click', handler.swapStyle)
;
$menu
.sidr({
name: 'menu'
})
;
};
// attach ready event
$(document)
.ready(shape.ready)
;