Skip to content

Commit

Permalink
Version 3.2.3
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
furcan committed Jan 29, 2022
1 parent 79c6f27 commit 2a8f920
Show file tree
Hide file tree
Showing 28 changed files with 146 additions and 88 deletions.
10 changes: 6 additions & 4 deletions .eslintrc.js → .dev/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// For TypeScript

module.exports = {
overrides: [{
files: ['*.d.ts', '*.ts', '*.tsx'],
Expand Down Expand Up @@ -38,9 +40,9 @@ module.exports = {
'single',
{
'avoidEscape': true,
'allowTemplateLiterals': true
}
]
'allowTemplateLiterals': true,
},
],
},
}],
}
};
43 changes: 43 additions & 0 deletions .dev/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2021
},
"rules": {
"comma-dangle": [
"error",
"always-multiline"
],
"semi": [
"error",
"always"
],
"indent": [
"error",
2,
{
"ignoredNodes": [
"TemplateLiteral"
]
}
],
"quotes": [
2,
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
]
}
}
2 changes: 1 addition & 1 deletion .dev/notiflix-dev-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Version: 1.0.0
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix - All In One, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix - All In One, MIT Licence (https://opensource.org/licenses/MIT)
*/

'use-strict';
Expand Down
4 changes: 2 additions & 2 deletions .dev/notiflix-dev-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Notiflix constants for the development.
* Version: 1.0.0
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix - Constants, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix - Constants, MIT Licence (https://opensource.org/licenses/MIT)
*/

// Dev Dependencies
Expand Down Expand Up @@ -68,7 +68,7 @@ module.exports = {
version: (JSON.stringify((package || {}).version) || '').replace(/"/gm, ''),
author: (JSON.stringify((package || {}).author) || '').replace(/"/gm, ''),
license: 'MIT Licence (https://opensource.org/licenses/MIT)',
year: '2019 - ' + (new Date().getFullYear() || '2021'),
year: '2019 - ' + (new Date().getFullYear() || '2022'),
directories: {
dist: 'dist',
build: 'build',
Expand Down
2 changes: 1 addition & 1 deletion .dev/notiflix-dev-minifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Version: 1.0.0
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix Minifier, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix Minifier, MIT Licence (https://opensource.org/licenses/MIT)
*/

'use-strict';
Expand Down
9 changes: 2 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 11
"ecmaVersion": 5
},
"rules": {
"comma-dangle": [
Expand All @@ -24,12 +24,7 @@
],
"indent": [
"error",
2,
{
"ignoredNodes": [
"TemplateLiteral"
]
}
2
],
"quotes": [
2,
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@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.
- Fixes => [#45](https://github.com/notiflix/Notiflix/issues/45)

---

@3.2.2
* **Fixed:** `Notiflix.Confirm.prompt()`: Input `maxlength` attribute value should not be directly related to the default answer length.
- Fixes => [#43](https://github.com/notiflix/Notiflix/issues/43)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 - 2021 Notiflix
Copyright (c) 2019 - 2022 Notiflix

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

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

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

### Current Version

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

### Browser Compatibility

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

#### CSS and JS
```html
<link rel="stylesheet" href="dist/notiflix-3.2.2.min.css" />
<link rel="stylesheet" href="dist/notiflix-3.2.3.min.css" />

<script src="dist/notiflix-3.2.2.min.js"></script>
<script src="dist/notiflix-3.2.3.min.js"></script>
```

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

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

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

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

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

<script src="dist/notiflix-block-aio-3.2.2.min.js"></script>
<script src="dist/notiflix-block-aio-3.2.3.min.js"></script>
```

---------
Expand Down Expand Up @@ -772,7 +769,7 @@ Notiflix.Block.init({
---------

### Copyright
Copyright &copy; 2019 - 2021 Notiflix
Copyright &copy; 2019 - 2022 Notiflix

### License
MIT license - https://opensource.org/licenses/MIT
17 changes: 10 additions & 7 deletions build/notiflix-aio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Notiflix AIO (https://notiflix.github.io)
* Description: This file has been created automatically that using "notiflix.js", and "notiflix.css" files.
* Version: 3.2.2
* Version: 3.2.3
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/

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

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

// clear timeout
Expand All @@ -1778,7 +1778,7 @@
var eachElement = allHTMLElements[i];
if (eachElement) {
// remove each element's class name
removeEachElementClassName(eachElement);
removeEachElementClassName(eachElement, blockClassName);

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

// extend new settings with the backup settings
newBlockSettings = commonExtendOptions(true, newBlockSettings, newBlockSettingsBackup);
var reverseSettingsTimeout = setTimeout(function () {
newBlockSettings = commonExtendOptions(true, newBlockSettings, newBlockSettingsBackup);
clearTimeout(reverseSettingsTimeout);
}, (delay || 0));
};
// BLOCK: Create or Remove: end

Expand Down
17 changes: 10 additions & 7 deletions build/notiflix-block-aio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Notiflix Block AIO (https://notiflix.github.io)
* Description: This file has been created automatically that using "notiflix.js", and "notiflix.css" files.
* Version: 3.2.2
* Version: 3.2.3
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/

/* global define */
Expand Down Expand Up @@ -345,7 +345,7 @@
blockCreateOrRemoveCounter++;
var notiflixBlockWrap = window.document.createElement('div');
notiflixBlockWrap.id = blockSettings.ID + '-' + blockCreateOrRemoveCounter;
notiflixBlockWrap.className = blockClassName + '-wrap' + (newBlockSettings.cssAnimation ? ' nx-with-animation' : '');
notiflixBlockWrap.className = blockClassName + (newBlockSettings.cssAnimation ? ' nx-with-animation' : '');
notiflixBlockWrap.style.position = newBlockSettings.position;
notiflixBlockWrap.style.zIndex = newBlockSettings.zindex;
notiflixBlockWrap.style.background = newBlockSettings.backgroundColor;
Expand Down Expand Up @@ -474,10 +474,10 @@
// Step 2A => Remove each block element: end

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

// clear timeout
Expand All @@ -492,7 +492,7 @@
var eachElement = allHTMLElements[i];
if (eachElement) {
// remove each element's class name
removeEachElementClassName(eachElement);
removeEachElementClassName(eachElement, blockClassName);

// remove each block element
eachBlockElement = eachElement.querySelectorAll('[id^=' + blockSettings.ID + ']');
Expand All @@ -506,7 +506,10 @@
}

// extend new settings with the backup settings
newBlockSettings = commonExtendOptions(true, newBlockSettings, newBlockSettingsBackup);
var reverseSettingsTimeout = setTimeout(function () {
newBlockSettings = commonExtendOptions(true, newBlockSettings, newBlockSettingsBackup);
clearTimeout(reverseSettingsTimeout);
}, (delay || 0));
};
// BLOCK: Create or Remove: end

Expand Down
4 changes: 2 additions & 2 deletions build/notiflix-confirm-aio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Notiflix Confirm AIO (https://notiflix.github.io)
* Description: This file has been created automatically that using "notiflix.js", and "notiflix.css" files.
* Version: 3.2.2
* Version: 3.2.3
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/

/* global define */
Expand Down
4 changes: 2 additions & 2 deletions build/notiflix-loading-aio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Notiflix Loading AIO (https://notiflix.github.io)
* Description: This file has been created automatically that using "notiflix.js", and "notiflix.css" files.
* Version: 3.2.2
* Version: 3.2.3
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/

/* global define */
Expand Down
4 changes: 2 additions & 2 deletions build/notiflix-notify-aio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Notiflix Notify AIO (https://notiflix.github.io)
* Description: This file has been created automatically that using "notiflix.js", and "notiflix.css" files.
* Version: 3.2.2
* Version: 3.2.3
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/

/* global define */
Expand Down
4 changes: 2 additions & 2 deletions build/notiflix-report-aio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Notiflix Report AIO (https://notiflix.github.io)
* Description: This file has been created automatically that using "notiflix.js", and "notiflix.css" files.
* Version: 3.2.2
* Version: 3.2.3
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2021 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/

/* global define */
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/notiflix-3.2.2.min.js → dist/notiflix-3.2.3.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 2a8f920

Please sign in to comment.