From 08207e334eeae04f44e1b04679ad775daf14810d Mon Sep 17 00:00:00 2001
From: Gabriel-Bowater <gd.bowater@gmail.com>
Date: Wed, 20 Jan 2016 14:20:53 +1300
Subject: [PATCH] add tabindex values to menu items to give a more logical tab
 flow through the page.

---
 .../CoreHome/angularjs/quick-access/quick-access.directive.html | 2 +-
 .../CoreHome/angularjs/siteselector/siteselector.directive.html | 2 +-
 plugins/CoreHome/templates/_logo.twig                           | 2 +-
 plugins/CoreHome/templates/_periodSelect.twig                   | 2 +-
 plugins/CoreHome/templates/_topBar.twig                         | 2 +-
 plugins/CoreHome/templates/_topScreen.twig                      | 2 +-
 plugins/Dashboard/templates/_dashboardSettings.twig             | 2 +-
 plugins/Morpheus/templates/dashboard.twig                       | 2 +-
 plugins/SegmentEditor/templates/_segmentSelector.twig           | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.html b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.html
index 1e76f4fe7d..107e2eb8e4 100644
--- a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.html
+++ b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.html
@@ -7,7 +7,7 @@
            ng-change="view.searchActive=true;quickAccess.searchMenu(search.term)"
            ng-focus="view.searchActive=true"
            ng-model="search.term" piwik-focus-if="view.searchActive"
-           type="text"/>
+           type="text" tabindex="2"/>
     <ul ng-hide="!search.term || !view.searchActive || (quickAccess.numMenuItems > 0) || (quickAccess.sitesModel.sites | length)">
         <li class="no-result">{{ 'General_SearchNoResults' | translate }}</li>
     </ul>
diff --git a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.html b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.html
index e4e46a676a..2eed933b49 100644
--- a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.html
+++ b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.html
@@ -18,7 +18,7 @@
        href="javascript:void(0)"
        title="{{ 'CoreHome_ChangeCurrentWebsite'|translate:((selectedSite.name || model.firstSiteName)|htmldecode) }}"
        ng-class="{'loading': model.isLoading}"
-       class="title">
+       class="title" tabindex="4">
         <span class="icon icon-arrow-bottom"
               ng-class="{'iconHidden': model.isLoading, 'collapsed': !view.showSitesList}"></span>
         <span>{{ 'General_Website'| translate }}:
diff --git a/plugins/CoreHome/templates/_logo.twig b/plugins/CoreHome/templates/_logo.twig
index ad28f5b68e..170f51ff3e 100644
--- a/plugins/CoreHome/templates/_logo.twig
+++ b/plugins/CoreHome/templates/_logo.twig
@@ -1,5 +1,5 @@
 <span id="logo">
-    <a href="index.php" title="{% if isCustomLogo %}{{ 'General_PoweredBy'|translate }} {% endif %}Piwik # {{ 'General_OpenSourceWebAnalytics'|translate }}">
+    <a href="index.php" title="{% if isCustomLogo %}{{ 'General_PoweredBy'|translate }} {% endif %}Piwik # {{ 'General_OpenSourceWebAnalytics'|translate }}" tabindex="3">
     {% if hasSVGLogo %}
         <img src='{{ logoSVG }}' alt="{% if isCustomLogo %}{{ 'General_PoweredBy'|translate }} {% endif %}Piwik" class="ie-hide {% if not isCustomLogo %}default-piwik-logo{% endif %}" />
         <!--[if lt IE 9]>
diff --git a/plugins/CoreHome/templates/_periodSelect.twig b/plugins/CoreHome/templates/_periodSelect.twig
index 67b30183d3..5df89ff25a 100644
--- a/plugins/CoreHome/templates/_periodSelect.twig
+++ b/plugins/CoreHome/templates/_periodSelect.twig
@@ -1,5 +1,5 @@
 <div id="periodString" piwik-expand-on-click class="piwikTopControl piwikSelector borderedControl periodSelector">
-    <a id="date" class="title" title="{{ 'General_ChooseDate'|translate|e('html_attr') }}">
+    <a id="date" class="title" title="{{ 'General_ChooseDate'|translate|e('html_attr') }}" tabindex="4">
         <span class="icon icon-calendar"></span>
         {{ prettyDate }}
     </a>
diff --git a/plugins/CoreHome/templates/_topBar.twig b/plugins/CoreHome/templates/_topBar.twig
index c1158f46bb..bc5261b70f 100644
--- a/plugins/CoreHome/templates/_topBar.twig
+++ b/plugins/CoreHome/templates/_topBar.twig
@@ -16,7 +16,7 @@
             <a {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %}
                class="topBarElem {% if (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %}active{% endif %}"
                id="topmenu-{{ menu._url.module|lower }}"
-               href="index.php{{ menu._url|urlRewriteWithParameters }}">{{ _self.menuItemLabel(label, menu._icon) }}</a>
+               href="index.php{{ menu._url|urlRewriteWithParameters }}" tabindex="3">{{ _self.menuItemLabel(label, menu._icon) }}</a>
         {% endif %}
     {% endmacro %}
 
diff --git a/plugins/CoreHome/templates/_topScreen.twig b/plugins/CoreHome/templates/_topScreen.twig
index 805619814c..f0ba5fc147 100644
--- a/plugins/CoreHome/templates/_topScreen.twig
+++ b/plugins/CoreHome/templates/_topScreen.twig
@@ -1,5 +1,5 @@
 <div id="header" class="container-fluid">
-    <a href="#main" tabindex="0" class="accessibility-skip-to-content">{{'CoreHome_SkipToContent'|translate}}</a>
+    <a href="#main" tabindex="1" class="accessibility-skip-to-content">{{'CoreHome_SkipToContent'|translate}}</a>
     <div id="topRightBar" class="navbar row">
         <div class="navbar-header col-md-3">
             <span class="toggle-second-menu icon-menu-hamburger"></span>
diff --git a/plugins/Dashboard/templates/_dashboardSettings.twig b/plugins/Dashboard/templates/_dashboardSettings.twig
index b82e913743..db21def819 100644
--- a/plugins/Dashboard/templates/_dashboardSettings.twig
+++ b/plugins/Dashboard/templates/_dashboardSettings.twig
@@ -1,4 +1,4 @@
-<a class="title" title="{{ 'Dashboard_ManageDashboard'|translate|e('html_attr') }}"><span class="icon icon-arrow-bottom"></span>{{ 'Dashboard_Dashboard'|translate }} </a>
+<a class="title" title="{{ 'Dashboard_ManageDashboard'|translate|e('html_attr') }}" tabindex="4"><span class="icon icon-arrow-bottom"></span>{{ 'Dashboard_Dashboard'|translate }} </a>
 <ul class="dropdown submenu">
     <li>
         <div class="addWidget">{{ 'Dashboard_AddAWidget'|translate }}</div>
diff --git a/plugins/Morpheus/templates/dashboard.twig b/plugins/Morpheus/templates/dashboard.twig
index afccc7bd4c..1f48987af7 100644
--- a/plugins/Morpheus/templates/dashboard.twig
+++ b/plugins/Morpheus/templates/dashboard.twig
@@ -39,13 +39,13 @@
 
         <div class="pageWrap">
 
-            <a name="main"></a>
 
             <div class="top_controls">
                 {% block topcontrols %}
                 {% endblock %}
             </div>
 
+            <a name="main"></a>
             {% block notification %}
                 {% include "@CoreHome/_notifications.twig" %}
             {% endblock %}
diff --git a/plugins/SegmentEditor/templates/_segmentSelector.twig b/plugins/SegmentEditor/templates/_segmentSelector.twig
index dc269dc8b9..18c885919a 100644
--- a/plugins/SegmentEditor/templates/_segmentSelector.twig
+++ b/plugins/SegmentEditor/templates/_segmentSelector.twig
@@ -1,6 +1,6 @@
 <div class="SegmentEditor" style="display:none;">
     <div class="segmentationContainer listHtml" title="{{ 'SegmentEditor_ChooseASegment'|translate|e('html_attr') }}. {{ 'SegmentEditor_CurrentlySelectedSegment'|translate(segmentDescription)|e('html_attr') }}">
-        <a class="title"><span class="icon icon-segment"></span><span class="segmentationTitle"></span></a>
+        <a class="title" tabindex="4"><span class="icon icon-segment"></span><span class="segmentationTitle"></span></a>
         <div class="dropdown dropdown-body">
             <div class="segmentFilterContainer">
                 <input class="segmentFilter" type="text" value="{{ 'General_Search'|translate }}"/>
-- 
GitLab