Github user sebfz1 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/120#discussion_r31118609
  
    --- Diff: 
wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/wicket-debugbar.js
 ---
    @@ -26,5 +26,45 @@ function wicketDebugBarToggleVisibility(elemID) {
        var elem = document.getElementById(elemID);
        var vis  = elem.style.display != 'none';
        elem.style.display = (vis ? 'none' : '');
    +    // alter the state cookie so we can initialize it properly on domReady
    +   wicketDebugBarSetExpandedCookie(vis ? 'collapsed' : 'expanded')
     }
     
    +function wicketDebugBarSetExpandedCookie(value) {
    +   document.cookie =  "wicketDebugBarState=" + window.escape(value);
    +}
    +
    +function wicketDebugBarGetExpandedCookie() {
    +   var name = 'wicketDebugBarState';
    +   if (document.cookie.length > 0) {
    +           var start = document.cookie.indexOf (name + "=");
    +           if (start !== -1) {
    +                   start = start + name.length + 1;
    +                   var end = document.cookie.indexOf(";", start);
    +                   if (end === -1) {
    +                           end = document.cookie.length;
    +                   }
    +                   return 
window.unescape(document.cookie.substring(start,end));
    +           } else {
    +                   return null;
    +           }
    +   } else {
    +           return null;
    +   }
    +}
    +
    +function wicketDebugBarCheckState() {
    +   var state = wicketDebugBarGetExpandedCookie();
    +    // state cookie has not been set. determine state and set it
    +   if (state === null) {
    +           var isVisible = $('#wicketDebugBarContents').is(':visible');
    +           wicketDebugBarSetExpandedCookie(isVisible ? 'expanded' : 
'collapsed');
    +    // set state of debug bar according to cookie
    +   } else {
    +           if (state === 'expanded') {
    +                   $('#wicketDebugBarContents').css('display', 'inherit');
    --- End diff --
    
    If it can help, the display issue is corrected when clicking on 
collapse/expand... It seems to be related only to the original state...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to