Glossary Button not showing up on pages

Issue #33 resolved
Anne EQS created an issue

The Glossary Button is not showing up on pages, for Blogposts it's working fine. Confluence 6.0.3, Keysight 2.2.5 Let me know any further information you need to retrace the issue.

Comments (5)

  1. Anne EQS reporter

    @selberg , not sure if it's the right way to add this issue here? Let me know if there is any better. Thx for Your Feedback, Anne

  2. Dennis Andersen

    Hi all, We’ve gotten a support request for this through our channels as well so I thought I’d follow up here as well. With RefinedTheme providing addition theming and layouts the default page container that the highlight dialog uses won’t match. We’ve got a workaround in place bundled in RefinedTheme were we change this to look at the correct place when the theme is enabled. (The default is $('.wiki-content').first() whereas RefinedTheme changes this to $('#main-content’))

    The issue lies in when other add-ons that modifies this are used together with RefinedTheme, as it’s not apparent which code will run first. In this case the glossary code is initialised first, and at that point Confluence.HighlightAction.WORKING_AREA.MAINCONTENT_ONLY points towards the ‘old’ selector. When RefinedTheme later changes this the handler for glossary is already registered and thus not changed.

    We’ll adress this in a future bug fix release of RefinedTheme. For an immediate fix, you could place the following code under Confluence Admin > Look and feel > Custom HTML > Beginning of BODY:

    #!
    
    <script>
    var $mainContent;
    var $mainAndCommentContent;
    
          Confluence.HighlightAction.WORKING_AREA = {
            MAINCONTENT_AND_COMMENT: function(selectionRange) {
              $mainAndCommentContent = $mainAndCommentContent || $('#main-content, .comment-content');
              return Confluence.HighlightAction.RangeHelper.isSelectionInsideContent($mainAndCommentContent,
                selectionRange);
            },
            MAINCONTENT_ONLY: function(selectionRange) {
              // Since the main content is static we do not need to perform the jquery selection again. This is unlike
              // comments which can be loaded via AJAX
              $mainContent = $mainContent || $('#main-content');
              return Confluence.HighlightAction.RangeHelper.isSelectionInsideContent($mainContent, selectionRange);
            },
            COMMENT_ONLY: function(selectionRange) {
              return Confluence.HighlightAction.RangeHelper.isSelectionInsideContent($('.comment-content'), selectionRange);
            }
          };
    </script>
    

    Best regards, Dennis Andersen Product Lead, RefinedTheme RefinedWiki

  3. Log in to comment