Support for button switches

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8842 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-08-23 08:57:58 +00:00
parent 8c8f3dc298
commit 0722dd0643

View file

@ -54,6 +54,27 @@ jQuery(function($){
.trigger('update.checkbox', [name, this.checked]);
});
// Button switch
$('button[name]')
.click(function(){
var $this = $(this), $radio;
$radio = $this.data('radio');
if(!$radio) {
$radio = $('<input type="radio" />').hide()
.attr('name', $this.attr('name'))
.attr('value', $this.attr('value'))
.insertBefore($this);
$this
.removeAttr('name')
.removeAttr('value')
.data('radio', $radio);
}
$radio.prop('checked', true);
});
// Global Navigation Bar
var $menuitems = $('div.gnb')
.removeClass('jx')