Skip to content

Commit

Permalink
[PROD-7433] Show Hide Schedule post button according to group privacy…
Browse files Browse the repository at this point in the history
… while applying draft
  • Loading branch information
amincdev committed May 16, 2024
1 parent bbad9ab commit fdda04f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/bp-templates/bp-nouveau/js/buddypress-activity-post-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,18 @@ window.bp = window.bp || {};
activity_data.object = 'groups';
}
}

// Show Hide Schedule post button according to group privacy.
if( 'group' === activity_data.privacy ) {
var schedule_allowed = $( '#whats-new-form' ).find( '#bp-item-opt-' + activity_data.item_id ).data( 'allow-schedule-post' );

if ( undefined !== typeof schedule_allowed && 'enabled' === schedule_allowed ) {
$( '#whats-new-form' ).find( '#bb-schedule-posts' ).show();
} else {
$( '#whats-new-form' ).find( '#bb-schedule-posts' ).hide();
}
}

// Set link image index and confirm image index.
self.postForm.model.set( 'link_image_index', activity_data.link_image_index_save );
self.postForm.model.set( 'link_image_index_save', activity_data.link_image_index_save );
Expand Down

Large diffs are not rendered by default.

0 comments on commit fdda04f

Please sign in to comment.