Highlight queries in the sidebar

pull/4809/head
Henriette Dinger 8 years ago
parent 9a21c7576f
commit 1d3d6b744d
  1. 6
      app/controllers/wiki_controller.rb
  2. 1
      config/locales/js-en.yml
  3. 7
      frontend/app/layout/query-menu-item-factory.js

@ -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|

@ -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}"

@ -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);

Loading…
Cancel
Save