BUGFIX: Fix Javascript for document type buttons. Style adds to only to selected doc type

This commit is contained in:
Ryan O'Hara 2012-08-06 17:33:52 +12:00
parent aa9075af79
commit 546546ced1
1 changed files with 18 additions and 20 deletions

View File

@ -3,29 +3,27 @@
$.entwine('ss', function($) {
$('#DocumentTypeID ul li').entwine({
onmatch: function() {
this.addClass('ui-button ss-ui-button ui-corner-all ui-state-default ui-widget ui-button-text-only');
this.parents('ul').removeClass('ui-tabs-nav');
},
});
$('#DocumentTypeID ul li').entwine({
onclick: function(e) {
if ($('input[type=radio]:checked').length > 0) {
this.addClass('selected');
}
//not.(this).removeClass('selected');
/* e.preventDefault();
this.parents('.cms-preview').loadUrl(this.attr('href'));
this.addClass('disabled');
this.parents('.cms-preview-states').find('a').not(this).removeClass('disabled');
//This hides all watermarks
this.parents('.cms-preview-states').find('.cms-preview-watermark').hide();
//Show the watermark for the current state
this.siblings('.cms-preview-watermark').show();*/
onadd: function() {
this.addClass('ui-button ss-ui-button ui-corner-all ui-state-default ui-widget ui-button-text-only');
this.parents('ul').removeClass('ui-tabs-nav');
},
});
$('#DocumentTypeID input[type=radio]').entwine({
onadd: function() {
if (this.is(':checked')) {
this.change();
}
},
onchange: function(e) {
$('#DocumentTypeID').find('li').removeClass('selected');
if (this.is(':checked')) {
this.parent('li').addClass('selected');
}
}
});
$('#Actions ul li').entwine({
onclick: function(e) {
e.preventDefault();