Skip to content

Commit

Permalink
refactor(tools): rename class to hide element impress-org#2875
Browse files Browse the repository at this point in the history
  • Loading branch information
raftaar1191 committed Apr 1, 2018
1 parent b766f06 commit 310318e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions assets/src/css/admin/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Forms CPT
display: none;
}

.give-visibility-hidden {
visibility: hidden;
}

/* Donation Levels Repeating Field */
#_give_donation_levels_repeat > .cmb-repeatable-grouping .cmb-field-list > .cmb-row .cmb2-radio-list label {
font-size: 12px;
Expand Down
13 changes: 9 additions & 4 deletions assets/src/js/admin/admin-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jQuery(document).ready(function ($) {
*/
$( '.give-export_donations #give-export_donations-form #give_form_for_csv_export' ).chosen().change( function () {

$( '.give-export-donations-hide' ).addClass( 'give-hidden' );
$( '.give-export-donations-hide' ).addClass( 'give-visibility-hidden' );

var give_form_id;

Expand All @@ -179,6 +179,7 @@ jQuery(document).ready(function ($) {
success: function ( response ) {

if ( response ) {

output_give_donations_fields( response );

} else {
Expand All @@ -196,6 +197,8 @@ jQuery(document).ready(function ($) {
*/
function output_give_donations_fields( response ) {



/**
* FFM Fields
*/
Expand All @@ -204,9 +207,11 @@ jQuery(document).ready(function ($) {
) ? response.ffm_fields : '';
var ffm_field_list = $( '.give-export-donations-ffm ul' );



if ( ffm_fields ) {

ffm_field_list.closest( 'tr' ).removeClass( 'give-hidden' );
ffm_field_list.closest( 'tr' ).removeClass( 'give-visibility-hidden' );

// Loop through FFM fields & output
$( ffm_fields ).each( function ( index, value ) {
Expand Down Expand Up @@ -251,7 +256,7 @@ jQuery(document).ready(function ($) {
) ? response.standard_fields : '';
var standard_field_list = $( '.give-export-donations-standard-fields ul' );
if ( standard_fields.length > 0 ) {
standard_field_list.closest( 'tr' ).removeClass( 'give-hidden' );
standard_field_list.closest( 'tr' ).removeClass( 'give-visibility-hidden' );
// Loop through STANDARD fields & output
$( standard_fields ).each( function ( index, value ) {
standard_field_list.append( '<li><label for="give-give-donations-standard-field-' + value + '"><input type="checkbox" name="give_give_donations_export_option[' + value + ']" id="give-give-donations-standard-field-' + value + '">' + value + '</label> </li>' );
Expand All @@ -265,7 +270,7 @@ jQuery(document).ready(function ($) {
var hidden_field_list = $( '.give-export-donations-hidden-fields ul' );

if ( hidden_fields ) {
hidden_field_list.closest( 'tr' ).removeClass( 'give-hidden' );
hidden_field_list.closest( 'tr' ).removeClass( 'give-visibility-hidden' );

// Loop through HIDDEN fields & output.
$( hidden_fields ).each( function ( index, value ) {
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/tools/export/class-give-export-donations.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function html() {
</td>
</tr>

<tr valign="top" class="give-hidden give-export-donations-hide give-export-donations-ffm">
<tr valign="top" class="give-visibility-hidden give-export-donations-hide give-export-donations-ffm">
<th scope="row" class="titledesc">
<label for="json"><?php _e( 'Form Field Manager Fields:', 'give' ); ?></label>
</th>
Expand All @@ -334,7 +334,7 @@ public function html() {
</td>
</tr>

<tr valign="top" class="give-hidden give-export-donations-hide give-export-donations-standard-fields">
<tr valign="top" class="give-visibility-hidden give-export-donations-hide give-export-donations-standard-fields">
<th scope="row" class="titledesc">
<label for="json"><?php _e( 'Custom Field Columns:', 'give' ); ?></label>
</th>
Expand All @@ -348,7 +348,7 @@ public function html() {
</td>
</tr>

<tr valign="top" class="give-hidden give-export-donations-hide give-export-donations-hidden-fields">
<tr valign="top" class="give-visibility-hidden give-export-donations-hide give-export-donations-hidden-fields">
<th scope="row" class="titledesc">
<label for="json"><?php _e( 'Hidden Custom Field Columns:', 'give' ); ?></label>
</th>
Expand Down

0 comments on commit 310318e

Please sign in to comment.