Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Connie DeCinko 931 posts 1160 karma points
    Jan 25, 2011 @ 21:55
    Connie DeCinko
    0

    Notifications Push Items Off Screen

    Especially when you have multiple notifications displaying at the top of the screen, the tabs are pushed lower on the screen, and sometimes off the screen.  It is not possible to scroll to see the bottom of the tab div/window.

     

  • Adam Nelson 27 posts 186 karma points c-trib
    Sep 15, 2011 @ 04:06
    Adam Nelson
    0

    I have a patch to fix this issue, along with the other issue where the Related Links datatype is affected by Page Notifications - postbacks aren't honoured and related links are not saved.

    I think the core issue comes down to modification of the controls collection breaking Related Links.

    To fix, grab the source from codeplex and update the ShowNotifications method from:

            protected void ShowNotification(ContentPlaceHolder placeHolder, string msg)
            {
                var panel = new Panel();
                panel.Style.Add("background-color", "#fff9c2");
                panel.Style.Add("border", "solid 1px #ffd800");
                panel.Style.Add("color", "#333333");
                panel.Style.Add("padding", "10px");
                panel.Style.Add("margin-bottom", "10px");
    
                var literal = new Literal();
                literal.Text = msg;
    
                panel.Controls.Add(literal);
    
                placeHolder.Controls.AddAt(0, panel);
            }

    to:

    protected void ShowNotification(ContentPlaceHolder placeHolder, string msg)
    {
        placeHolder.Controls.Add(new Literal
        {
          Text = String.Format("<script type=\"text/javascript\">\n$(function(){{ " +
                               "$(\"div.tabpageContent\").prepend(\"" +
                               "<div style='background-color:#fff9c2;border:solid 1px #ffd800;" +
                               "color:#333;padding:10px;margin-top:10px;text-align:left'>{0}</div>\"); }});\n</script>\n", msg) });
    }

    Which uses jQuery at the bottom of the control collection (does not seem to affect Related Links) to prepend a message to the top of the page (inside the scrollable container).

Please Sign in or register to post replies

Write your reply to:

Draft