Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1229800

    Hi,
    My problem concerns tab section. Here is an example: http://www.sensity.pl/umow-spotkanie-online/rezerwowa/.

    I placed dynamic booking form to the first tab. I set auto adjusting height to content because in the second tab I placed another very high form.
    Unfortunately the dynamic booking form on the first tab becomes cut: https://snipboard.io/uar1ho.jpg.
    It think the auto height is adopted to login widget on the right. It is even easier to see when you choose any values from both dropdown menus and go forward clicking “dalej” (next). On the second step you can see that a calendar is hidden: https://snipboard.io/aVieNM.jpg

    Here is how is should work: https://www.sensity.pl/umow-spotkanie-online/ (works fine because I took booking form above from tab section).
    Is there any way to make it work in the tab?

    #1230586

    Hey kwlodar,

    Thank you for the update.

    We might be able to force the tab section to resize after clicking on the next or previous button in the forms, but we have to access the site first and check it further. The script might look something like this:

    (function($) {
        $('.bookly-box button').on('click', function() {
           var tab = $(this).parents('.av-layout-tab');
            var id = tab.data('av-tab-section-content');
    
            $('.av-section-tab-title[data-av-tab-section-title="' + id + '"]').trigger('click');
        })
    })(jQuery);

    Best regards,
    Ismael

    #1230703

    OK, let’s try. Do you need a temporary admin access to my site?
    Regards!
    Chris

    #1231114

    Hi Chris,

    Yes, we do. Please post admin login details in private.

    Best regards,
    Rikard

    #1231142

    Thank you! Login link attached.

    One note: pages mentioned above are just an examples. I’d like to have this dynamic resize working on each tab selection element, so I have place booking form this way anywhere in the service.

    I’d like to ask you also to let me know what you did when you finish. I don’t use child them (shame on me! I know…) and I transfer some settings from functions.php between versions. I need to know if I have to transfer anything else.

    Regards!

    #1231634

    Hi,

    Thank you for the update.

    The form button sends an AJAX request when clicked, so we can wait for that request and reset the height of the tab section afterwards. We tried to add the script in the functions.php via Appearance > Editor panel but we always get an SFTP error or notice. We may need to access the file server directly.

    If you want to test it yourself, just add this code in the functions.php file.

    
    add_action("wp_footer", "ava_bookly_resizer", 9999);
    function ava_bookly_resizer() {
    ?>
    <script>
    (function($) {
    	var s_ajaxListener = new Object();
    	s_ajaxListener.tempOpen = XMLHttpRequest.prototype.open;
    	s_ajaxListener.tempSend = XMLHttpRequest.prototype.send;
    	s_ajaxListener.callback = function () {
    	setTimeout(function() {
    		$(window).trigger('debouncedresize av-content-el-height-changed');
    	}, 500);
    	}
    
    	XMLHttpRequest.prototype.open = function(a,b) {
    	if (!a) var a='';
    	if (!b) var b='';
    	s_ajaxListener.tempOpen.apply(this, arguments);
    	s_ajaxListener.method = a;  
    	s_ajaxListener.url = b;
    	if (a.toLowerCase() == 'get') {
    		s_ajaxListener.data = b.split('?');
    		s_ajaxListener.data = s_ajaxListener.data[1];
    	}
    	}
    
    	XMLHttpRequest.prototype.send = function(a,b) {
    	if (!a) var a='';
    	if (!b) var b='';
    	s_ajaxListener.tempSend.apply(this, arguments);
    	if(s_ajaxListener.method.toLowerCase() == 'post')s_ajaxListener.data = a;
    	s_ajaxListener.callback();
    	}
    })(jQuery);
    </script>
    <?php
    }
    

    Or post the SFTP details in the private field so that we can test the modification.

    Source: https://gist.github.com/alecperkins/3889507

    Best regards,
    Ismael

    #1291454

    Sorry for it took so long…
    I’ve implemented the code you suggested in functions.php, but it seems not working. :(
    I’ve created another test site: https://www.sensity.pl/bookly-test-site/

    1. First tab loads too low even on the beginning: https://snipboard.io/IC09s3.jpg.
    2. After switching to the second tab the high is ok (same content), and switching back to the first the height also becomes fine.
    3. After filling the form and kicking “dalej” button the content isn’t visible (too low height): https://snipboard.io/cWrKbj.jpg, but again – switching to second tab and going back to the first makes the height correct: https://snipboard.io/PdXQqn.jpg

    Any other ideas how to make tabs adjusting its height correctly based on content?

    Adding login url just in case.

    Edit: Try to do it basing on tabs (not tab selection) and the funny thing is – works perfectly! So why tab selection don’t? I leave it on the site below so you can check it.

    • This reply was modified 3 years ago by kwlodar.
    #1292006

    Hi,

    Thank you for the update. And welcome back!

    We adjusted the above code a bit. Please try it again.

    Best regards,
    Ismael

    #1292918

    Hi Ismael, thank you for reply!
    I’ve updated functions.php with the code again but I can not see any difference – the tab selection module act as before. :(

    I’ve reactivate your login link for another week.

    #1293427

    Hi,

    Thank you for your patience.

    We added another snippet to resize the tab section on load, which works fine, but the tab section is still not resizing consistently after going to the next step. You might have to refrain from using the tab section when using the bookly form.

    This is the snippet that we added.

    var int = window.setInterval(function(){
    		console.log("resizing");
    		$(window).trigger('debouncedresize');
    		$("a[href$=online-booking]").trigger("click");
    	}, 1000);
    
    	$(window).load(function () {	
    		setTimeout(function() {
    			clearInterval(int);
    		}, 1000
    

    Best regards,
    Ismael

    #1294524

    Hi Ismael,
    sorry to hear that. :(
    I believe I have to give up and search for different solution.
    Best regards!
    Chris

    #1294951

    Hi Chris,

    Thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.