Skip to content

Commit 42bbf89

Browse files
committed
MAGETWO-32907: Move Magento_Theme Cookie code to Magento_Cookie
- Moved cookieBlock (widget for handling cookie notices) requirejs config from Theme to Cookie module - Renamed cookieBlock to cookieNotices
1 parent 4b54a23 commit 42bbf89

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

app/code/Magento/Cookie/View/frontend/requirejs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
requireCookie: 'Magento_Cookie/js/require-cookie'
9+
requireCookie: 'Magento_Cookie/js/require-cookie',
10+
cookieNotices: 'Magento_Cookie/js/notices'
1011
}
1112
}
1213
};

app/code/Magento/Cookie/View/frontend/templates/html/notices.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
], function($){
2727

2828
// <![CDATA[
29-
$('#notice-cookie-block').mage('cookieBlock', {
29+
$('#notice-cookie-block').mage('cookieNotices', {
3030
cookieAllowButtonSelector: '#btn-cookie-allow',
3131
cookieName: '<?php echo \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>',
3232
cookieValue: '<?php echo $this->helper('Magento\Cookie\Helper\Cookie')->getAcceptedSaveCookiesWebsiteIds() ?>',

app/code/Magento/Cookie/View/frontend/web/js/notices.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ define([
99
"mage/cookies"
1010
], function($){
1111

12-
$.widget('mage.cookieBlock', {
12+
$.widget('mage.cookieNotices', {
1313
_create: function() {
1414
if ($.mage.cookies.get(this.options.cookieName)) {
1515
this.element.hide();
@@ -28,5 +28,5 @@ define([
2828
}
2929
});
3030

31-
return $.mage.cookieBlock;
31+
return $.mage.cookieNotices;
3232
});

app/code/Magento/Theme/view/frontend/requirejs-config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
var config = {
77
map: {
88
"*": {
9-
"cookieBlock": "Magento_Cookie/js/notices",
109
"rowBuilder": "Magento_Theme/js/row-builder",
1110
"toggleAdvanced": "mage/toggle",
1211
"translateInline": "mage/translate-inline",

0 commit comments

Comments
 (0)