From 1d3d6b744d17d19ad5374eb36101e9e80aea9f0e Mon Sep 17 00:00:00 2001 From: Henriette Dinger Date: Mon, 22 Aug 2016 13:06:09 +0200 Subject: [PATCH] Highlight queries in the sidebar --- app/controllers/wiki_controller.rb | 6 +----- config/locales/js-en.yml | 1 + frontend/app/layout/query-menu-item-factory.js | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index d97d5cc63f..46e37cbdc6 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -70,11 +70,7 @@ class WikiController < ApplicationController attr_reader :page, :related_page current_menu_item :index do |controller| - controller.current_menu_item_sym :related_page, '_toc' - end - - current_menu_item :new_child do |controller| - controller.current_menu_item_sym :page, '_new_page' + controller.current_menu_item_sym :related_page end current_menu_item do |controller| diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml index a226300064..1a880655d3 100644 --- a/config/locales/js-en.yml +++ b/config/locales/js-en.yml @@ -62,6 +62,7 @@ en: button_export-pdf: "Download PDF" button_export-atom: "Download Atom" description_available_columns: "Available Columns" + description_current_position: "You are here:" description_select_work_package: "Select work package #%{id}" description_selected_columns: "Selected Columns" description_subwork_package: "Child of work package #%{id}" diff --git a/frontend/app/layout/query-menu-item-factory.js b/frontend/app/layout/query-menu-item-factory.js index e08a0dc466..31b0b6418f 100644 --- a/frontend/app/layout/query-menu-item-factory.js +++ b/frontend/app/layout/query-menu-item-factory.js @@ -48,6 +48,13 @@ module.exports = function(menuItemFactory, $state, $stateParams, $animate, $time // No idea though, why these sometimes are null and sometimes are undefined. element.toggleClass('selected', $state.includes('work-packages') && (scope.queryId == $stateParams.query_id)); + + // Add hidden info for blind users + element.prop('title', I18n.t('js.description_current_position') + element.prop('title')); + var hiddenLabel = document.createElement('span'); + hiddenLabel.addClassName('hidden-for-sighted'); + hiddenLabel.innerHTML = I18n.t('js.description_current_position'); + element[0].insertBefore(hiddenLabel, element[0].firstChild); } scope.$on('openproject.layout.activateMenuItem', setActiveState);