From c904ec1a15ec4f9b8519b5c67b0ca8643c0ba9c4 Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Thu, 27 Feb 2014 13:51:13 +1300 Subject: [PATCH] Seems like 3.1.1 doesnt like multiple togglefields in the same tab.. --- code/extensions/SiteTreeContentReview.php | 6 ++---- javascript/contentreview.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/extensions/SiteTreeContentReview.php b/code/extensions/SiteTreeContentReview.php index c327879..25e2a68 100644 --- a/code/extensions/SiteTreeContentReview.php +++ b/code/extensions/SiteTreeContentReview.php @@ -312,16 +312,14 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider $fields->addFieldsToTab("Root.ContentReview", array( new HeaderField(_t('ContentReview.REVIEWHEADER', "Content review"), 2), $viewersOptionsField, - CompositeField::create( - ReadonlyField::create('ROContentOwners', _t('ContentReview.CONTENTOWNERS', 'Content Owners'), $this->getOwnerNames()), - ReadonlyField::create('RONextReviewDate', _t("ContentReview.NEXTREVIEWDATE", "Next review date"), $this->owner->NextReviewDate) - )->addExtraClass('inherited-settings'), CompositeField::create( $userField, $groupField, $reviewDate, $reviewFrequency )->addExtraClass('custom-settings'), + ReadonlyField::create('ROContentOwners', _t('ContentReview.CONTENTOWNERS', 'Content Owners'), $this->getOwnerNames()), + ReadonlyField::create('RONextReviewDate', _t("ContentReview.NEXTREVIEWDATE", "Next review date"), $this->owner->NextReviewDate), $notesField )); } diff --git a/javascript/contentreview.js b/javascript/contentreview.js index a655c5d..a7eab90 100644 --- a/javascript/contentreview.js +++ b/javascript/contentreview.js @@ -16,7 +16,7 @@ jQuery(function($) { // Constructor: onmatch onmatch: function() { var self = this; - this.find('.optionset :input').on('change', function(e) { + this.find('.optionset :input').bind('change', function(e) { self.show_option(e.target.value); }); @@ -26,8 +26,7 @@ jQuery(function($) { this._super(); }, onunmatch: function() { - this.find('.optionset :input').off('change'); - this._super(); + return this._super(); }, show_option: function(value) { @@ -42,15 +41,18 @@ jQuery(function($) { _custom: function() { $('.custom-settings')['show'](); - $('.inherited-settings')['hide'](); + $('#ROContentOwners')['hide'](); + $('#RONextReviewDate')['hide'](); }, _inherited: function() { - $('.inherited-settings')['show'](); $('.custom-settings')['hide'](); + $('#ROContentOwners')['show'](); + $('#RONextReviewDate')['show'](); }, _disabled: function() { - $('.inherited-settings')['hide'](); $('.custom-settings')['hide'](); + $('#ROContentOwners')['hide'](); + $('#RONextReviewDate')['hide'](); } });