- fixed privacy policy toggler

This commit is contained in:
yuriinalivaiko
2022-07-31 19:06:55 +03:00
parent 275f4a422e
commit 5f271c82c6
2 changed files with 17 additions and 17 deletions
+12 -12
View File
@@ -1,22 +1,22 @@
(function ( $ ) {
'use strict';
$(document).on('click', "a.um-toggle-gdpr" ,function() {
$( document ).on( 'click', 'a.um-toggle-gdpr', function ( e ) {
let $a = jQuery( e.currentTarget );
let $area = $a.closest( '.um-field-area' );
let $content = $area.find( '.um-gdpr-content' );
var me = jQuery(this);
$( ".um-gdpr-content" ).toggle( "fast", function() {
if( $( ".um-gdpr-content" ).is(':visible') ){
me.text( me.data('toggle-hide') );
if ( $content.is( ':visible' ) ) {
$area.find( 'a.um-toggle-gdpr' ).text( $a.data( 'toggle-show' ) );
$content.hide().find( 'a.um-toggle-gdpr' ).remove();
if ( $a.length ) {
$a.get( 0 ).scrollIntoView();
}
if( $( ".um-gdpr-content" ).is(':hidden') ){
me.text( me.data('toggle-show') );
} else {
$area.find( 'a.um-toggle-gdpr' ).text( $a.data( 'toggle-hide' ) );
$content.show().prepend( $a.clone() );
}
} );
});
})( jQuery );
+1 -1
View File
@@ -1 +1 @@
!function(e){"use strict";e(document).on("click","a.um-toggle-gdpr",function(){var t=jQuery(this);e(".um-gdpr-content").toggle("fast",function(){e(".um-gdpr-content").is(":visible")&&t.text(t.data("toggle-hide")),e(".um-gdpr-content").is(":hidden")&&t.text(t.data("toggle-show"))})})}(jQuery);
!function(){"use strict";jQuery(document).on("click","a.um-toggle-gdpr",function(e){let t=jQuery(e.currentTarget),g=t.closest(".um-field-area"),o=g.find(".um-gdpr-content");o.is(":visible")?(g.find("a.um-toggle-gdpr").text(t.data("toggle-show")),o.hide().find("a.um-toggle-gdpr").remove(),t.length&&t.get(0).scrollIntoView()):(g.find("a.um-toggle-gdpr").text(t.data("toggle-hide")),o.show().prepend(t.clone()))})}();