mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-29 08:09:58 +09:00
Theme manager UI
1. add theme.js 2. modify some style related to theme preview git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8694 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b00f2a0581
commit
e14a9a8388
3 changed files with 80 additions and 4 deletions
74
modules/admin/tpl/js/theme.js
Normal file
74
modules/admin/tpl/js/theme.js
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
jQuery(function($){
|
||||
|
||||
$('#theme,#skin')
|
||||
// all thumbnail area
|
||||
.find('>.thumbPreview')
|
||||
// thumbnail list
|
||||
.find('.a')
|
||||
.has('li.i:nth-child(2)')
|
||||
.after('<a href="#" class="prevToggle">Show</a>')
|
||||
.next('a.prevToggle')
|
||||
.click(function(){
|
||||
var $list = $(this).prev('.a');
|
||||
|
||||
if($list.parent().hasClass('active')) {
|
||||
$list.trigger('hide.tp');
|
||||
} else {
|
||||
$list.trigger('show.tp');
|
||||
}
|
||||
|
||||
return false;
|
||||
})
|
||||
.end()
|
||||
.end()
|
||||
.bind('show.tp', function(){
|
||||
$(this)
|
||||
.parent().addClass('active').end()
|
||||
.find('>.i:gt(0)')
|
||||
.slideDown(100, function(){
|
||||
var $this = $(this);
|
||||
|
||||
if(!$this.prev('.checked').length) return;
|
||||
});
|
||||
})
|
||||
.bind('hide.tp', function(){
|
||||
$(this)
|
||||
.parent().removeClass('active').end()
|
||||
.find('>.i:gt(0)')
|
||||
.slideUp(100, function(){
|
||||
var $this = $(this);
|
||||
|
||||
if(!$this.prev('.checked').length) return;
|
||||
});
|
||||
})
|
||||
.end()
|
||||
.find('.i:not(:first-child)').hide().end()
|
||||
.bind('paint.pr', function(){
|
||||
$(this)
|
||||
.find('.i')
|
||||
.removeClass('checked')
|
||||
.find('.checkIcon').remove().end()
|
||||
.end()
|
||||
.find('.i:has(>input:checked)')
|
||||
.addClass('checked')
|
||||
.each(function(){
|
||||
var $this = $(this);
|
||||
$this.parent().prepend($this);
|
||||
})
|
||||
.end()
|
||||
.find('.i.checked').show();
|
||||
})
|
||||
.trigger('paint.pr')
|
||||
.find('span.thumb')
|
||||
.attr('role', 'radio') // WAI-ARIA role
|
||||
.click(function(){
|
||||
var $radio = $(this).next('input:radio');
|
||||
|
||||
$radio.is(':checked')?
|
||||
$radio.closest('.a').trigger('show.tp') :
|
||||
$radio.prop('checked', true).change();
|
||||
})
|
||||
.next('input:radio').change(function(){ $(this).closest('.a').trigger('paint.pr') }).end()
|
||||
.end()
|
||||
.end()
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue