Vanilla open source was terminated 1 January 2025 by Higher Logic. See this announcement for more information.

Load/reload the Notifications FlyoutMenu using AJAX

oliverraduneroliverraduner ✭✭
edited October 2015 in Vanilla 2.0 - 2.8

Hi there,
As I understand, the Notification menu (notifications popin) is not rendered on page load but it's content and thus the whole menu is loaded on the first click. Correct?

So can anyone help me to understand, how I can basically reload this menu using an AJAX-request (no page load required)?

Looking forward to any hints :)
Oliver

Comments

  • If you look at the HTML before you first click the notifications item, you see that markup:

    <span rel="/profile/notificationspopin" class="ToggleFlyout"><a title="Notifications" class="MeButton FlyoutButton js-clear-notifications" href="/profile/R_J"><span class="Sprite Sprite16 SpNotifications"></span><em>Notifications</em></a><span class="Arrow SpFlyoutHandle"></span><div class="Flyout FlyoutMenu"></div></span>
    
    <span rel="/profile/notificationspopin" class="ToggleFlyout">
        <a title="Notifications" class="MeButton FlyoutButton js-clear-notifications" href="/profile/R_J">
            <span class="Sprite Sprite16 SpNotifications"></span>
            <em>Notifications</em>
        </a>
        <span class="Arrow SpFlyoutHandle"></span>
        <div class="Flyout FlyoutMenu"></div>
    </span>
    

    The only thing of interest for you is the following:

    (...)
    <span rel="/profile/notificationspopin" class="ToggleFlyout">
    (...)
        <div class="Flyout FlyoutMenu"></div>
    </span>
    

    Into this empty div, the following code is inserted: http://vanillaforums.org/profile/notificationspopin&DeliveryType=VIEW

    So what you would have to do is to empty this div and add the code from the link above again.

  • Thank you @R_J , I think I'll figure it out with this! Amazing

Sign In or Register to comment.