Skip to content

Commit

Permalink
Breeze integration
Browse files Browse the repository at this point in the history
  • Loading branch information
vovayatsyuk committed Sep 14, 2021
1 parent c8cc761 commit 8d0a8da
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Magento_Theme/layout/breeze_default.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="breeze.js">
<arguments>
<argument name="bundles" xsi:type="array">
<item name="default" xsi:type="array">
<item name="items" xsi:type="array">
<item name="theme-custom" xsi:type="string">js/breeze/custom</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
22 changes: 22 additions & 0 deletions web/js/breeze/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(function () {
'use strict';

$(document).on('breeze:load', function () {
$('.header.content > .header.links')
.clone()
.data('breeze-temporary', true)
.appendTo(document.getElementById('store.links'));

// Expanding search field onFocus
$('.header #search').on('focus', function () {
$(this).parents('.block-search').addClass('expanded');
});

$('.header #search').on('blur', function () {
$(this).parents('.block-search').removeClass('expanded');
});

// Hide empty sidebar blocks
$('.sidebar .block-title.no-display').parents('.block').hide();
});
})();

0 comments on commit 8d0a8da

Please sign in to comment.