Skip to content
Snippets Groups Projects
Commit 97b2e809 authored by Oleksii Korshenko's avatar Oleksii Korshenko
Browse files

MAGETWO-44084: There is no block/message on frontend for "accept cookies" if...

MAGETWO-44084: There is no block/message on frontend for "accept cookies" if Cookie Restriction Mode = Yes
parent b0818724
Branches
No related merge requests found
......@@ -8,6 +8,7 @@ define([
"jquery/ui",
"mage/cookies"
], function($){
"use strict";
$.widget('mage.cookieNotices', {
_create: function() {
......@@ -18,6 +19,7 @@ define([
}
$(this.options.cookieAllowButtonSelector).on('click', $.proxy(function() {
var cookieExpires = new Date(new Date().getTime() + this.options.cookieLifetime * 1000);
$.mage.cookies.set(this.options.cookieName, this.options.cookieValue, {expires: cookieExpires});
if ($.mage.cookies.get(this.options.cookieName)) {
window.location.reload();
......@@ -29,4 +31,4 @@ define([
});
return $.mage.cookieNotices;
});
\ No newline at end of file
});
......@@ -30,6 +30,7 @@ define([
*/
_bind: function() {
var events = {};
$.each(this.options.triggers, function(index, value) {
events['click ' + value] = '_checkCookie';
});
......@@ -50,4 +51,4 @@ define([
});
return $.mage.requireCookie;
});
\ No newline at end of file
});
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment