Want to add a class to body/html when modal is opened

This topic has 10 replies, 2 voices, and was last updated 6 years, 6 months ago ago by Olga Barlow

  • Avatar: kumapanda
    kumapanda
    Participant
    October 17, 2017 at 12:38

    Hi there,

    It would be great if you can guide me a bit. I want to add a class when a modal is opnened to the html or body. I tried it that way: please see private content.

    Please, contact administrator
    for this information.
    9 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    October 17, 2017 at 15:04

    Hello,

    1) ; is missing after jQuery('html,body').removeClass('product-reviews-modal-open')
    2) It depends on where you added the code because it should be placed before jQuery starts.

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    October 17, 2017 at 17:36

    Hi Olga,

    I added the code in my functions.php:

    function modalopenoverflow() {
        if( wp_script_is( 'jquery', 'done' ) ) {
        ?>
          <script type="text/javascript">	
    
    jQuery(document).ready(function() {
    jQuery('#wc-product-reviews-pro-modal').on('show', function () {
    jQuery('html,body').addClass('product-reviews-modal-open');
    }).on('hidden', function () {
      jQuery('html,body').removeClass('product-reviews-modal-open');
    });
    });
       </script>
        <?php
        }
    }
    add_action( 'wp_footer', 'modalopenoverflow' );
    

    I think I miss something. Can you please help me to sort that out? :). For sure I will Bug hunting for ystore theme in the future too ;).

    thank you!

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    October 18, 2017 at 12:32

    Hello,

    We have fixed code on your site but keep in mind that additional customization questions are outside the scope of our support. Our developers won’t be able to help you with them next time because if they spend the time fixing customers’ customization issues they don’t have time to work on our themes. Thank you for your understanding.

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    October 18, 2017 at 18:22

    Thank you Olga! Such a great Support :). I completely understand your point. But thank you for the help!!!

    For sure I will tell you bugs and other things in the future.

    I have found 2 ;). It would be enough when you fix this with the next update.

    1. Missing translation string “posts”. See hidden content for samples.
    2. There is a very strange behaviour of the widget titles. Sometimes they are bold and sometimes not. Please see example in hidden content. Scroll down to the footer of the pages please. Maybe it has something to do with Revolution Slider?

    Thank you and keep up the good work!!!

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    October 20, 2017 at 10:08

    Hello,

    1) Sync translation with the latest pot file and translation should appear http://prntscr.com/gzovv6

    2) Problem is related to font family and font weight that were used on your site for the widget titles. Check now.

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    October 20, 2017 at 10:21

    Hi Olga,
    1) I synched the pot file for sure and translated that string. I double checked it. I think you missed this string in php files… Please check it :)! Blog and search archive…

    2) Thank you!

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    October 20, 2017 at 10:46

    Hello,

    Check now http://prntscr.com/gzpsq8 .

    Regards

    Avatar: kumapanda
    kumapanda
    Participant
    October 20, 2017 at 10:52

    Thank you. Did you modified the theme files? Please add the fix to the upcoming update :)… THANK YOU!

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    October 20, 2017 at 17:25

    Hello,

    We just updated pot file and sync translation. It will be updated in next theme update.

    Regards

  • Viewing 10 results - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.