Skip to content

Commit 4f7e659

Browse files
ENGCOM-7752: Remove over complicated setup for closing minicart dropdown #28906
- Merge Pull Request #28906 from lumnn/magento2:feature-remove-close-sidebar - Merged commits: 1. 1cb5685
2 parents 48d7868 + 1cb5685 commit 4f7e659

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,6 @@ define([
123123
$('[data-block="minicart"]').find('[data-role="dropdownDialog"]').dropdownDialog('close');
124124
},
125125

126-
/**
127-
* @return {Boolean}
128-
*/
129-
closeSidebar: function () {
130-
var minicart = $('[data-block="minicart"]');
131-
132-
minicart.on('click', '[data-action="close"]', function (event) {
133-
event.stopPropagation();
134-
minicart.find('[data-role="dropdownDialog"]').dropdownDialog('close');
135-
});
136-
137-
return true;
138-
},
139-
140126
/**
141127
* @param {String} productType
142128
* @return {*|String}

app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
id="btn-minicart-close"
2222
class="action close"
2323
data-action="close"
24-
data-bind="attr: { title: $t('Close') }">
24+
data-bind="
25+
attr: {
26+
title: $t('Close')
27+
},
28+
click: closeMinicart()
29+
">
2530
<span translate="'Close'"/>
2631
</button>
2732

@@ -74,7 +79,6 @@
7479

7580
<ifnot args="getCartParam('summary_count')">
7681
<strong class="subtitle empty"
77-
data-bind="visible: closeSidebar()"
7882
translate="'You have no items in your shopping cart.'"
7983
/>
8084
<if args="getCartParam('cart_empty_message')">

0 commit comments

Comments
 (0)