-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1717 from rtCamp/develop
Version update v4.6.6
- Loading branch information
Showing
8 changed files
with
118 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,8 +59,13 @@ jQuery( function( $ ) { | |
* https://wordpress.org/plugins/buddypress-edit-activity/ | ||
*/ | ||
$.ajaxPrefilter( function( options, originalOptions, jqXHR ) { | ||
if ( 'undefined' === typeof originalOptions || 'undefined' === typeof originalOptions.data || 'buddypress-edit-activity-save' !== originalOptions.data.action ) { | ||
return; | ||
// Modify options, control originalOptions, store jqXHR, etc | ||
try { | ||
if ( null === originalOptions.data || typeof ( originalOptions.data ) === 'undefined' || typeof ( originalOptions.data.action ) === 'undefined' || 'buddypress-edit-activity-save' !== originalOptions.data.action ) { | ||
return true; | ||
} | ||
} catch ( e ) { | ||
return true; | ||
} | ||
|
||
if ( ! $( '#activity-' + originalOptions.data.activity_id ).hasClass( 'rtmedia_update' ) ) { | ||
|
@@ -396,6 +401,9 @@ jQuery( function( $ ) { | |
} ); | ||
} ); | ||
$( this ).parent().remove(); | ||
|
||
/** Scroll function called */ | ||
rtMediaScrollComments(); | ||
} ); | ||
|
||
$( document ).on( 'keypress', '#rtmedia_go_to_num', function( e ) { | ||
|
@@ -1826,6 +1834,9 @@ jQuery( document ).ready( function( $ ) { | |
rtmedia_reset_video_and_audio_for_popup(); | ||
|
||
rtMediaHook.call( 'rtmedia_js_after_comment_added', [ ] ); | ||
|
||
/** Scroll function called */ | ||
rtMediaScrollComments(); | ||
}, | ||
error: function( data ) { | ||
if ( widget_id ) { | ||
|
@@ -2926,3 +2937,16 @@ function rtmedia_disable_popup_navigation( $selector ){ | |
} ); | ||
} ); | ||
} | ||
|
||
/** | ||
* Function that smooth scrolls to the latest comment in rtMedia. | ||
* Created on 23-Nov-2020 by Vipin Kumar Dinkar <[email protected]> | ||
*/ | ||
const rtMediaScrollComments = () => { | ||
const commentBox = document.getElementById( 'rtmedia_comment_ul' ); | ||
|
||
if ( commentBox !== null ) { | ||
const commentsToScroll = ( commentBox.offsetHeight ) * 1000; | ||
commentBox.scrollTo( { top: commentsToScroll, behavior: 'smooth' } ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters