Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-54987

AJS.$('#labels-section') resolves to AJS.$(' (None) -section')

XMLWordPrintable

      Description:

      AJS.$('#labels-section') resolves to AJS.$(' (None) -section') when used in Main Layout template causing the selector to fail during execution.

       

      To Reproduce:
      Add the following code

       

      #if ($userAccessor.hasMembership('confluence-users', $helper.action.remoteUser.name))
      #else
          <script type="text/javascript">
          AJS.toInit(function(){                   
             AJS.$('#labels-section').hide(); 
          });
      </script>
      #end
      

      to Main layout template just after </html> tag. Debug on page refresh and notice "#labels" has been replaced with "(None)".

      Expected:

      Selector resolves to #labels

       

      Actual:

      Selector resolves to (None)

       

      Temporary workaround:
      Replace

      AJS.$('#labels-section').hide()
      

      with

      document.getElementById("labels-section").style.display = "none";

      Link to Community post:

      https://community.atlassian.com/t5/Confluence-questions/After-upgrade-to-6-7-hiding-certain-selectors-doesn-t-work/qaq-p/726448#M97766

              Unassigned Unassigned
              c4896499e489 Christo Mastoroudes [Adaptavist]
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: