Skip to content

Commit 2a8f920

Browse files
committed
Version 3.2.3
Fixed: `Notiflix.Block.*`: The custom class name option was not being set correctly. The temporary position class name for the reference element was not being removed if it was being used with a custom class name. [#45](#45)
1 parent 79c6f27 commit 2a8f920

28 files changed

+146
-88
lines changed

.eslintrc.js renamed to .dev/.eslintrc.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// For TypeScript
2+
13
module.exports = {
24
overrides: [{
35
files: ['*.d.ts', '*.ts', '*.tsx'],
@@ -38,9 +40,9 @@ module.exports = {
3840
'single',
3941
{
4042
'avoidEscape': true,
41-
'allowTemplateLiterals': true
42-
}
43-
]
43+
'allowTemplateLiterals': true,
44+
},
45+
],
4446
},
4547
}],
46-
}
48+
};

.dev/.eslintrc.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true
7+
},
8+
"extends": "eslint:recommended",
9+
"globals": {
10+
"Atomics": "readonly",
11+
"SharedArrayBuffer": "readonly"
12+
},
13+
"parserOptions": {
14+
"ecmaVersion": 2021
15+
},
16+
"rules": {
17+
"comma-dangle": [
18+
"error",
19+
"always-multiline"
20+
],
21+
"semi": [
22+
"error",
23+
"always"
24+
],
25+
"indent": [
26+
"error",
27+
2,
28+
{
29+
"ignoredNodes": [
30+
"TemplateLiteral"
31+
]
32+
}
33+
],
34+
"quotes": [
35+
2,
36+
"single",
37+
{
38+
"avoidEscape": true,
39+
"allowTemplateLiterals": true
40+
}
41+
]
42+
}
43+
}

.dev/notiflix-dev-builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Version: 1.0.0
77
* Author: Furkan MT (https://github.com/furcan)
8-
* Copyright 2019 - 2021 Notiflix - All In One, MIT Licence (https://opensource.org/licenses/MIT)
8+
* Copyright 2019 - 2022 Notiflix - All In One, MIT Licence (https://opensource.org/licenses/MIT)
99
*/
1010

1111
'use-strict';

.dev/notiflix-dev-constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Description: Notiflix constants for the development.
55
* Version: 1.0.0
66
* Author: Furkan MT (https://github.com/furcan)
7-
* Copyright 2019 - 2021 Notiflix - Constants, MIT Licence (https://opensource.org/licenses/MIT)
7+
* Copyright 2019 - 2022 Notiflix - Constants, MIT Licence (https://opensource.org/licenses/MIT)
88
*/
99

1010
// Dev Dependencies
@@ -68,7 +68,7 @@ module.exports = {
6868
version: (JSON.stringify((package || {}).version) || '').replace(/"/gm, ''),
6969
author: (JSON.stringify((package || {}).author) || '').replace(/"/gm, ''),
7070
license: 'MIT Licence (https://opensource.org/licenses/MIT)',
71-
year: '2019 - ' + (new Date().getFullYear() || '2021'),
71+
year: '2019 - ' + (new Date().getFullYear() || '2022'),
7272
directories: {
7373
dist: 'dist',
7474
build: 'build',

.dev/notiflix-dev-minifier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Version: 1.0.0
77
* Author: Furkan MT (https://github.com/furcan)
8-
* Copyright 2019 - 2021 Notiflix Minifier, MIT Licence (https://opensource.org/licenses/MIT)
8+
* Copyright 2019 - 2022 Notiflix Minifier, MIT Licence (https://opensource.org/licenses/MIT)
99
*/
1010

1111
'use-strict';

.eslintrc.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"SharedArrayBuffer": "readonly"
1212
},
1313
"parserOptions": {
14-
"ecmaVersion": 11
14+
"ecmaVersion": 5
1515
},
1616
"rules": {
1717
"comma-dangle": [
@@ -24,12 +24,7 @@
2424
],
2525
"indent": [
2626
"error",
27-
2,
28-
{
29-
"ignoredNodes": [
30-
"TemplateLiteral"
31-
]
32-
}
27+
2
3328
],
3429
"quotes": [
3530
2,

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
@3.2.3
2+
* **Fixed:** `Notiflix.Block.*`: The custom class name option was not being set correctly. The temporary position class name for the reference element was not being removed if it was being used with a custom class name.
3+
- Fixes => [#45](https://github.com/notiflix/Notiflix/issues/45)
4+
5+
---
6+
17
@3.2.2
28
* **Fixed:** `Notiflix.Confirm.prompt()`: Input `maxlength` attribute value should not be directly related to the default answer length.
39
- Fixes => [#43](https://github.com/notiflix/Notiflix/issues/43)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 - 2021 Notiflix
3+
Copyright (c) 2019 - 2022 Notiflix
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
[npm-version-badge]: https://img.shields.io/npm/v/notiflix.svg
1111
[npm-version-url]: https://www.npmjs.com/package/notiflix
12-
[dep-badge]: https://david-dm.org/notiflix/Notiflix.svg
13-
[dep-url]: https://david-dm.org/notiflix/Notiflix.svg
1412
[synk-badge]: https://snyk.io/test/github/notiflix/Notiflix/badge.svg?targetFile=package.json
1513
[synk-url]: https://snyk.io/test/github/notiflix/Notiflix?targetFile=package.json
1614
[typescript-badge]: https://badgen.net/badge/icon/Typed?icon=typescript&label&labelColor=3178c6&color=555
@@ -19,12 +17,11 @@
1917
[downloads-url]: https://npmjs.org/package/notiflix
2018
[jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/notiflix/badge?style=rounded
2119
[jsdelivr-url]: https://www.jsdelivr.com/package/npm/notiflix
22-
[size-badge]: https://img.badgesize.io/https://cdn.jsdelivr.net/npm/[email protected].2/dist/notiflix-aio-3.2.2.min.js?compression=gzip
23-
[size-url]: https://cdn.jsdelivr.net/npm/[email protected].2/dist/notiflix-aio-3.2.2.min.js
20+
[size-badge]: https://img.badgesize.io/https://cdn.jsdelivr.net/npm/[email protected].3/dist/notiflix-aio-3.2.3.min.js?compression=gzip
21+
[size-url]: https://cdn.jsdelivr.net/npm/[email protected].3/dist/notiflix-aio-3.2.3.min.js
2422
[lic-badge]: https://img.shields.io/github/license/notiflix/Notiflix.svg
2523
[lic-url]: https://github.com/notiflix/Notiflix/blob/main/LICENSE
2624

27-
<!-- [![Dependencies][dep-badge]][dep-url] -->
2825
[![npm version][npm-version-badge]][npm-version-url]
2926
[![Known Vulnerabilities][synk-badge]][synk-url]
3027
[![TypeScript][typescript-badge]][typescript-url]
@@ -39,7 +36,7 @@ Notiflix is a JavaScript library for client-side non-blocking notifications, pop
3936

4037
### Current Version
4138

42-
3.2.2 [*](https://github.com/notiflix/Notiflix/blob/main/CHANGELOG.md "CHANGELOG")
39+
3.2.3 [*](https://github.com/notiflix/Notiflix/blob/main/CHANGELOG.md "CHANGELOG")
4340

4441
### Browser Compatibility
4542

@@ -100,27 +97,27 @@ import { Block } from 'notiflix/build/notiflix-block-aio';
10097

10198
#### CSS and JS
10299
```html
103-
<link rel="stylesheet" href="dist/notiflix-3.2.2.min.css" />
100+
<link rel="stylesheet" href="dist/notiflix-3.2.3.min.css" />
104101

105-
<script src="dist/notiflix-3.2.2.min.js"></script>
102+
<script src="dist/notiflix-3.2.3.min.js"></script>
106103
```
107104

108105
#### or only JS (All in One - Internal CSS)
109106
```html
110-
<script src="dist/notiflix-aio-3.2.2.min.js"></script>
107+
<script src="dist/notiflix-aio-3.2.3.min.js"></script>
111108
```
112109

113110
#### or only Modules JS (All in One - Internal CSS)
114111
```html
115-
<script src="dist/notiflix-notify-aio-3.2.2.min.js"></script>
112+
<script src="dist/notiflix-notify-aio-3.2.3.min.js"></script>
116113

117-
<script src="dist/notiflix-report-aio-3.2.2.min.js"></script>
114+
<script src="dist/notiflix-report-aio-3.2.3.min.js"></script>
118115

119-
<script src="dist/notiflix-confirm-aio-3.2.2.min.js"></script>
116+
<script src="dist/notiflix-confirm-aio-3.2.3.min.js"></script>
120117

121-
<script src="dist/notiflix-loading-aio-3.2.2.min.js"></script>
118+
<script src="dist/notiflix-loading-aio-3.2.3.min.js"></script>
122119

123-
<script src="dist/notiflix-block-aio-3.2.2.min.js"></script>
120+
<script src="dist/notiflix-block-aio-3.2.3.min.js"></script>
124121
```
125122

126123
---------
@@ -772,7 +769,7 @@ Notiflix.Block.init({
772769
---------
773770

774771
### Copyright
775-
Copyright &copy; 2019 - 2021 Notiflix
772+
Copyright &copy; 2019 - 2022 Notiflix
776773

777774
### License
778775
MIT license - https://opensource.org/licenses/MIT

build/notiflix-aio.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
* Notiflix AIO (https://notiflix.github.io)
33
* Description: This file has been created automatically that using "notiflix.js", and "notiflix.css" files.
4-
* Version: 3.2.2
4+
* Version: 3.2.3
55
* Author: Furkan MT (https://github.com/furcan)
6-
* Copyright 2019 - 2021 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
6+
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
77
*/
88

99
/* global define */
@@ -1631,7 +1631,7 @@
16311631
blockCreateOrRemoveCounter++;
16321632
var notiflixBlockWrap = window.document.createElement('div');
16331633
notiflixBlockWrap.id = blockSettings.ID + '-' + blockCreateOrRemoveCounter;
1634-
notiflixBlockWrap.className = blockClassName + '-wrap' + (newBlockSettings.cssAnimation ? ' nx-with-animation' : '');
1634+
notiflixBlockWrap.className = blockClassName + (newBlockSettings.cssAnimation ? ' nx-with-animation' : '');
16351635
notiflixBlockWrap.style.position = newBlockSettings.position;
16361636
notiflixBlockWrap.style.zIndex = newBlockSettings.zindex;
16371637
notiflixBlockWrap.style.background = newBlockSettings.backgroundColor;
@@ -1760,10 +1760,10 @@
17601760
// Step 2A => Remove each block element: end
17611761

17621762
// Step 2B => Remove each element's class name: begin
1763-
var removeEachElementClassName = function (eachElement) {
1763+
var removeEachElementClassName = function (eachElement, className) {
1764+
var positionClass = className + '-position';
17641765
var timeout = setTimeout(function () {
17651766
// remove class name
1766-
var positionClass = blockClassName + '-position';
17671767
eachElement.classList.remove(positionClass);
17681768

17691769
// clear timeout
@@ -1778,7 +1778,7 @@
17781778
var eachElement = allHTMLElements[i];
17791779
if (eachElement) {
17801780
// remove each element's class name
1781-
removeEachElementClassName(eachElement);
1781+
removeEachElementClassName(eachElement, blockClassName);
17821782

17831783
// remove each block element
17841784
eachBlockElement = eachElement.querySelectorAll('[id^=' + blockSettings.ID + ']');
@@ -1792,7 +1792,10 @@
17921792
}
17931793

17941794
// extend new settings with the backup settings
1795-
newBlockSettings = commonExtendOptions(true, newBlockSettings, newBlockSettingsBackup);
1795+
var reverseSettingsTimeout = setTimeout(function () {
1796+
newBlockSettings = commonExtendOptions(true, newBlockSettings, newBlockSettingsBackup);
1797+
clearTimeout(reverseSettingsTimeout);
1798+
}, (delay || 0));
17961799
};
17971800
// BLOCK: Create or Remove: end
17981801

0 commit comments

Comments
 (0)