Bład proszę spróbować później.
diff --git a/wp-content/themes/hello-elementor/assets/js/custom.js b/wp-content/themes/hello-elementor/assets/js/custom.js index 499bbb3..138cba4 100644 --- a/wp-content/themes/hello-elementor/assets/js/custom.js +++ b/wp-content/themes/hello-elementor/assets/js/custom.js @@ -191,14 +191,51 @@ jQuery(function ($) { }) }) -jQuery(function ($) { - $('#frame-box .actions .text').on('click', function () { - $('.text-data', this).toggleClass('active') - }) -}) +// jQuery(function ($) { +// $('#frame-box .actions .text').on('click', function () { +// $('.text-data', this).toggleClass('active') +// }) +// }) + +jQuery(document).ready(function($) { + $('.song.text').on('click', function() { + const songId = $(this).attr('data-song-id'); + + $.ajax({ + url: '/wp-admin/admin-ajax.php', + type: 'POST', + data: { + action: 'get_song_text', + song_id: songId + }, + beforeSend: function() { + $('#song-text-box').html('
Ładowanie...
'); + }, + success: function(response) { + $('#song-text-box').addClass('active'); + $('#song-text-box').html(response); + }, + error: function() { + $('#song-text-box').addClass('active'); + $('#song-text-box').html('Bład proszę spróbować później.