Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Load/reload the Notifications FlyoutMenu using AJAX

oliverraduneroliverraduner Contributing to Vanilla since 2010Switzerland ✭✭
edited October 2015 in Vanilla 2.0 - 2.3

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

UnderDog

Comments

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    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.

    oliverradunerhgtonight
  • oliverraduneroliverraduner Contributing to Vanilla since 2010 Switzerland ✭✭

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

    hgtonight
Sign In or Register to comment.