From 50263f0ef18c7b0c09f5e499f76343357f7f0707 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara Date: Thu, 16 Aug 2012 17:01:57 +1200 Subject: [PATCH] MINOR: Duplicate jQuery functions for embargo and expiry fields when adding documents - this adds the relevant classes for the styling changes to work --- css/DMSDocumentCMSFields.css | 2 +- javascript/DMSDocumentCMSFields.js | 12 ++++++++++-- scss/DMSDocumentCMSFields.scss | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/css/DMSDocumentCMSFields.css b/css/DMSDocumentCMSFields.css index 19a8840..f7159c2 100644 --- a/css/DMSDocumentCMSFields.css +++ b/css/DMSDocumentCMSFields.css @@ -25,7 +25,7 @@ form.small .field input.text, form.small .field textarea, form.small .field sele #Actions li.dms-active { border-bottom: 1px solid #C0C0C2; background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #c0c0c0), color-stop(100%, #e6e6e6)); background: -webkit-linear-gradient(#c0c0c0, #e6e6e6); background: -moz-linear-gradient(#c0c0c0, #e6e6e6); background: -o-linear-gradient(#c0c0c0, #e6e6e6); background: -ms-linear-gradient(#c0c0c0, #e6e6e6); background: linear-gradient(#c0c0c0, #e6e6e6); box-shadow: 0 1px 1px 0 #A0A0A0 inset; } #Actions li.dms-active:after { content: ''; display: block; position: absolute; top: 33px; left: 50%; margin-left: -6px; width: 12px; height: 12px; background: #F8F8F8; border-right: 1px solid #B3B3B3; border-top: 1px solid #B3B3B3; -moz-transform: rotate(-45deg); -webkit-transform: rotate(-45deg); pointer-events: none; } -#ActionsPanel .middleColumn { margin-left: 184px; } +#ActionsPanel .middleColumn { margin-left: 184px; width: 510px; } form.small #ActionsPanel .middleColumn { margin-left: 120px; } #ActionsPanel label.fieldholder-small-label { display: none; } #ActionsPanel .fieldgroup-field { float: none; width: auto; } diff --git a/javascript/DMSDocumentCMSFields.js b/javascript/DMSDocumentCMSFields.js index b83e109..2a99bb1 100644 --- a/javascript/DMSDocumentCMSFields.js +++ b/javascript/DMSDocumentCMSFields.js @@ -43,7 +43,7 @@ } }); - $('#Form_ItemEditForm_Embargo input').entwine({ + $('#Form_ItemEditForm_Embargo input, #Form_EditForm_Embargo input').entwine({ onchange: function() { //selected the date options if (this.attr('value') === 'Date') { @@ -54,7 +54,7 @@ } }); - $('#Form_ItemEditForm_Expiry input').entwine({ + $('#Form_ItemEditForm_Expiry input, #Form_EditForm_Expiry input').entwine({ onchange: function() { //selected the date options if (this.attr('value') === 'Date') { @@ -80,12 +80,20 @@ $('#Form_ItemEditForm_EmbargoedUntilDate-date').closest('.fieldholder-small').addClass('embargoDatetime').hide(); $('#Form_ItemEditForm_ExpireAtDate-date').closest('.fieldholder-small').addClass('expiryDatetime').hide(); + // We need to duplicate the above functions to work when Adding documents + $('#Form_EditForm_EmbargoedUntilDate-date').closest('.fieldholder-small').addClass('embargoDatetime').hide(); + $('#Form_EditForm_ExpireAtDate-date').closest('.fieldholder-small').addClass('expiryDatetime').hide(); + //show the replace panel when the page loads $('li[data-panel="embargo"]').click(); //set the initial state of the radio button and the associated dropdown hiding $('#Form_ItemEditForm_Embargo input[checked]').change(); $('#Form_ItemEditForm_Expiry input[checked]').change(); + + //Again we need to duplicate the above function to work when adding documents + $('#Form_EditForm_Embargo input[checked]').change(); + $('#Form_EditForm_Expiry input[checked]').change(); } }); diff --git a/scss/DMSDocumentCMSFields.scss b/scss/DMSDocumentCMSFields.scss index 797c259..0aa5759 100644 --- a/scss/DMSDocumentCMSFields.scss +++ b/scss/DMSDocumentCMSFields.scss @@ -133,6 +133,7 @@ form.small .field .TreeDropdownField, #ActionsPanel{ .middleColumn{ margin-left:184px; + width: 510px; form.small &{ margin-left: 120px; }