diff --git a/javascript/DMSDocumentCMSFields.js b/javascript/DMSDocumentCMSFields.js index f29d0b4..1eb4aba 100644 --- a/javascript/DMSDocumentCMSFields.js +++ b/javascript/DMSDocumentCMSFields.js @@ -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();