Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-47674

Action Menu is not built correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Deferred
    • Affects Version/s: 2.8
    • Fix Version/s: None
    • Component/s: Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_28_STABLE

      Description

      In trying to understand how the action menu is created I found that it is built wrongly, at least compared with the dropdown menus used in Bootstrap.
      This is how a bootstrap single dropdown menu list looks like:

      <ul class="nav navbar-nav">
          <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                  <ul class="dropdown-menu">
                  <li><a href="#">Action1</a></li>
                  <li class="divider"></li>
                  <li><a href="#">Action2</a></li>
                  <li class="divider"></li>
                  <li><a href="#">Action3</a></li>                        
              </ul>
          </li>
      </ul>                
      

      And this is how the Usermenu (action menu) looks:

      <div class="userinfo">
      <span class="userbutton">
      <span class="usertext">Admin User</span>
      <span class="avatars">
      <span class="avatar current">
      <img class="userpicture defaultuserpic" width="35" height="35" role="presentation" title="" alt="" src="">
      </span>
      </span>
      </span>
      </div>
      <div id="action-menu-0" class="moodle-actionmenu show" data-enhance="moodle-core-actionmenu" data-enhanced="1">
      <ul id="action-menu-0-menubar" class="menubar" role="menubar">
      <li role="presentation">
      <a id="action-menu-toggle-0" class="toggle-display textmenu">
      <span class="accesshide">User menu</span>
      <b class="caret"></b>
      </a>
      </li>
      </ul>
      <ul id="action-menu-0-menu" class="menu align-tr-br" >
      <li role="presentation"></li>
      <li role="presentation"><li>
      <li role="presentation"><li>
      <li role="presentation"><li>
      <li role="presentation"><li>
      </ul>
      </div>
      </div>
      

      Where the Bootstrap has a nested pair of unordered lists and the user (action menu) are two separate unordered lists making for what looks like an overly complicated lines of code, which I am sure could be simplified especially if Bootstrap CSS selectors where added instead of those thought up for the codes original purpose.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              lazydaisy Mary Evans
              Participants:
              Component watchers:
              Bas Brands
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: