summaryrefslogtreecommitdiffstats
path: root/core/modules/toolbar/toolbar.module
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/toolbar/toolbar.module')
-rw-r--r--core/modules/toolbar/toolbar.module19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index 34d36c1..788378c 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -175,18 +175,19 @@ function toolbar_pre_render($element) {
// Get the configured breakpoints to switch from vertical to horizontal
// toolbar presentation.
- $breakpoints = entity_load('breakpoint_group', 'module.toolbar.toolbar');
+ $breakpoints = \Drupal::service('breakpoint.manager')->getBreakpointsByGroup('toolbar');
if (!empty($breakpoints)) {
- $media_queries = array();
- $media_queries['toolbar']['breakpoints'] = array_map(
- function ($object) {
- return $object->mediaQuery;
- },
- $breakpoints->getBreakpoints()
- );
+ $media_queries = array();
+ foreach ($breakpoints as $id => $breakpoint) {
+ $media_queries[$id] = $breakpoint->getMediaQuery();
+ }
$element['#attached']['js'][] = array(
- 'data' => $media_queries,
+ 'data' => array(
+ 'toolbar' => array(
+ 'breakpoints' => $media_queries,
+ )
+ ),
'type' => 'setting',
);
}