Skip to content

Commit

Permalink
Merge pull request #31 from peckadesign/0-cookieConsent-close-events
Browse files Browse the repository at this point in the history
Extension `cookieConsent` při zavírání modálu vyvolává události
  • Loading branch information
zipper authored Feb 9, 2023
2 parents 0147f82 + d3cbe58 commit eef1eeb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Vlastní extensions pro nette.ajax

## Changelog

### 1.4.14
- Extension cookieConsent při zavírání modálu vyvolává dvě události - `cookieConsentBeforeClose` a `cookieConsentAfterClose`.

### 1.4.13
- Dependency update, povolení vyšší verze `nette.ajax.js` (`^2.4.0`).

Expand Down
3 changes: 3 additions & 0 deletions extensions/pd/cookieConsent.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@
var $consentEl = settings.nette.form.closest('.js-cookie-consent');
var closingDuration = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cookie-consent-closing-duration') || 0);

document.dispatchEvent(new CustomEvent('cookieConsentBeforeClose', { bubbles: true }))

$consentEl.addClass('js-cookie-consent--close');

setTimeout(function() {
$consentEl.remove();
document.dispatchEvent(new CustomEvent('cookieConsentAfterClose', { bubbles: true }))
}, closingDuration);
}
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pd.ajax",
"title": "pd.ajax",
"description": "Collection of nette ajax extensions, including `pd` for creating disabled-by-deafult extensions",
"version": "1.4.13",
"version": "1.4.14",
"author": "PeckaDesign, s.r.o <support@peckadesign.cz>",
"contributors": [
"Radek Šerý <radek.sery@peckadesign.cz>",
Expand Down
2 changes: 1 addition & 1 deletion pd.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright Copyright (c) 2015 Jiří Pudil
* @license MIT
*
* @version 1.4.13
* @version 1.4.14
*/
(function ($, undefined) {
var extensions = {};
Expand Down

0 comments on commit eef1eeb

Please sign in to comment.