Okay
  Public Ticket #2283589
top event in open state as default?
Closed

Comments

  •  1
    eigenwijsheid started the conversation

    Hi there,

    At the moment, there is only 1 event in de calender. The calender page shows upcoming events. Because it doesn't look nice closed, I'd like the top event to be in open state as default, is that possible? 

    Current shortcode used = [stachethemes_ec view="agenda" show_top=0 agenda_cal_display=0 cal=1]

    Thanks!

  •  894
    Zhivko replied

    Hi,

    Try following:

    Open your theme functions.php file and at the bottom add:

    add_action('stec_after_html', function() {
        ?>
        <script type="text/javascript">
            (function ($) {
                var triggered = false;
                $.stecExtend(function (m) {
                    if (m.glob.options.view === 'agenda' && false === triggered) {
                        m.$instance.find('.stec-layout-agenda-events-all-list .stec-layout-event').first().trigger(m.helper.clickHandle());
                        triggered = true;
                    }
                }, 'onLayoutSet');
            })(window.jQuery);
        </script>
        <?php
    });

    Stachethemes Developer

  •  1
    eigenwijsheid replied

    Works like a charm Zhivko. Thanks!!