Skip to content

Commit

Permalink
Merge branch 'master' into magento2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Jul 31, 2018
2 parents be3197d + 65e8101 commit c184498
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
3 changes: 2 additions & 1 deletion Block/Messages/PrivacyMessagePopup.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ private function getCookieDisclosureInformation(): string
if (!$this->hasData('cookie_disclosure_information')) {
$block = $this->getLayout()->createBlock(
Block::class,
'opengento.gdpr.cookie.disclosure.information',
['data' => ['block_id' => $this->config->getCookieDisclosureInformationBlockId()]]
);
$this->setData('cookie_disclosure_information', $block);
$this->setData('cookie_disclosure_information', $block->toHtml());
}

return (string) $this->_getData('cookie_disclosure_information');
Expand Down
13 changes: 3 additions & 10 deletions view/frontend/web/js/view/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,26 @@ define([
return Component.extend({
showPopUp: ko.observable(null),
popupText: ko.observable(null),
popupLink: ko.observable(null),

defaults: {
template: 'Opengento_Gdpr/message'
},

/**
* Initialize component.
* Initialize component
*/
initialize: function () {
this._super();

this.showPopUp(!$.cookie(this.cookieName));
this.popupText(this.notificationText);
this.popupLink(this.learnMore);

$(document).on('click', '#enhanced-privacy-popup-agree', function () {
this.showPopUp(false);
$.cookie(this.cookieName, 1);
}.bind(this));
},

/**
* Get URL to information page.
*
* @returns {*}
*/
getLearnMoreLink: function () {
return this.learnMore;
}
});
});
4 changes: 2 additions & 2 deletions view/frontend/web/template/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<div class="popup content">
<strong data-bind="i18n: 'Cookie Disclosure'"></strong>
<div class="block-content">
<p data-bind="text: notificationText"></p>
<div data-bind="html: notificationText"></div>
<div class="actions-toolbar">
<div class="secondary">
<a class="action" data-bind="attr: {href: getLearnMoreLink() }, i18n: 'Read More'"></a>
<a class="action" data-bind="attr: {href: learnMore}, i18n: 'Read More'"></a>
</div>
<div class="primary">
<button type="button" class="action primary" id="enhanced-privacy-popup-agree" data-bind="i18n: 'Accept'"></button>
Expand Down

0 comments on commit c184498

Please sign in to comment.