Move secondary tasks collapsible theme overrides to farm_ui_theme.
This commit is contained in:
parent
e971c13910
commit
3cd5de573b
|
@ -1,5 +1,5 @@
|
|||
name: farmOS UI Menu
|
||||
description: Provides farmOS toolbar menu overrides.
|
||||
description: Provides farmOS menu and toolbar overrides.
|
||||
type: module
|
||||
package: farmOS UI
|
||||
core_version_requirement: ^9
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
menu_local_task:
|
||||
css:
|
||||
theme:
|
||||
css/menu-local-task.css: { }
|
|
@ -72,36 +72,3 @@ function farm_ui_menu_local_tasks_alter(&$local_tasks) {
|
|||
unset($local_tasks[$task_id]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme().
|
||||
*/
|
||||
function farm_ui_menu_theme($existing, $type, $theme, $path) {
|
||||
return [
|
||||
'menu_local_tasks__farm' => [
|
||||
'base hook' => 'menu_local_tasks',
|
||||
],
|
||||
'menu_local_task__secondary' => [
|
||||
'base hook' => 'menu_local_task',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme_suggestions_HOOK().
|
||||
*/
|
||||
function farm_ui_menu_theme_suggestions_menu_local_task(array $variables) {
|
||||
// Add suggestions for primary and secondary task levels.
|
||||
$suggestions = [];
|
||||
if (isset($variables['element']['#level'])) {
|
||||
$suggestions[] = 'menu_local_task__' . $variables['element']['#level'];
|
||||
}
|
||||
return $suggestions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme_suggestions_HOOK().
|
||||
*/
|
||||
function farm_ui_menu_theme_suggestions_menu_local_tasks(array $variables) {
|
||||
return ['menu_local_tasks__farm'];
|
||||
}
|
||||
|
|
|
@ -24,6 +24,10 @@ map:
|
|||
css/map.css: { }
|
||||
dependencies:
|
||||
- farm_map/farm_map
|
||||
menu_local_task:
|
||||
css:
|
||||
theme:
|
||||
css/menu-local-task.css: { }
|
||||
quick:
|
||||
css:
|
||||
theme:
|
||||
|
|
|
@ -16,12 +16,37 @@ function farm_ui_theme_theme($existing, $type, $theme, $path) {
|
|||
'html__asset__map_popup' => [
|
||||
'base hook' => 'html',
|
||||
],
|
||||
'menu_local_tasks__farm' => [
|
||||
'base hook' => 'menu_local_tasks',
|
||||
],
|
||||
'menu_local_task__secondary' => [
|
||||
'base hook' => 'menu_local_task',
|
||||
],
|
||||
'page__asset__map_popup' => [
|
||||
'base hook' => 'page',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme_suggestions_HOOK().
|
||||
*/
|
||||
function farm_ui_theme_theme_suggestions_menu_local_task(array $variables) {
|
||||
// Add suggestions for primary and secondary task levels.
|
||||
$suggestions = [];
|
||||
if (isset($variables['element']['#level'])) {
|
||||
$suggestions[] = 'menu_local_task__' . $variables['element']['#level'];
|
||||
}
|
||||
return $suggestions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_theme_suggestions_HOOK().
|
||||
*/
|
||||
function farm_ui_theme_theme_suggestions_menu_local_tasks(array $variables) {
|
||||
return ['menu_local_tasks__farm'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_element_info_alter().
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* @see template_preprocess_menu_local_task()
|
||||
*/
|
||||
#}
|
||||
{{ attach_library('farm_ui_menu/menu_local_task') }}
|
||||
{{ attach_library('farm_ui_theme/menu_local_task') }}
|
||||
{%
|
||||
set classes = [
|
||||
'tabs__tab',
|
Loading…
Reference in New Issue