Okay
  Public Ticket #2150620
Click Direct to Single Page from Month/Week views?
Closed

Comments

  • MattConnollyTH started the conversation

    When I click on an event within "Month" or "Week" views, a small preview of the event is shown, and then I need to click on that preview in order to get to the "Single Page View".


    Is there a way to skip the second click and go directly into the single page view when clicking on the event name shown on the "day"?

  •  877
    Zhivko replied

    Hi,

    Try out this code (add it in theme functions.php file at the bottom)

    add_action('stec_after_html', function() {
        ?>
        <script type="text/javascript">
            (function ($) {
                $.stecExtend(function (m) {
                    m.glob.options.general_settings.event_auto_focus = 0;
                    m.$instance.$month.on(m.helper.clickHandle(), '.stec-layout-month-daycell-events li', function (e) {
                        e.preventDefault();
                        m.eventsHandler.eventToggle($(this));
                        m.eventsHandler.eventHolder.close();
                    });
                    m.$instance.$week.on(m.helper.clickHandle(), '.stec-layout-week-daycell-events li', function (e) {
                        e.preventDefault();
                        m.eventsHandler.eventToggle($(this));
                        m.eventsHandler.eventHolder.close();
                    });
                });
            })(window.jQuery);
        </script>
        <?php
    });

    Stachethemes Developer

  •  2
    jshawbigyam replied

    This seems to be a solution that will handle the issue in the month view.

    add_action('stec_after_html', function() {
    ?>
        <script type="text/javascript">
            (function ($) {
                $.stecExtend(function (m) {
                    m.glob.options.general_settings.event_auto_focus = 0;
                    m.$instance.$month.on(m.helper.clickHandle(), '.stec-layout-month-daycell-events li', function (e) {
                        e.preventDefault();
                        m.eventsHandler.eventHolder.close();
                    });
                    m.$instance.$month.on(m.helper.clickHandle(), '.stec-layout-month-daycell-event', function () {
                        var id = parseInt($(this).data('id'), 10);
                        var offset = parseInt($(this).data('repeatTimeOffset'), 10);
                        var event = m.calData.getEventById(id);
                        var permalink = m.helper.getPermalink(event.permalink, offset);
                        window.open(permalink,'_self');
                    });
                });
            })(window.jQuery);
        </script>
        <?php
    });