Skip to content

Commit

Permalink
Version 3.2.4
Browse files Browse the repository at this point in the history
Fixed: `Notiflix.Block.*`: The temporary position class name for the reference element has been changed to a constant text. [#47](#47)
  • Loading branch information
furcan committed Jan 29, 2022
1 parent 2a8f920 commit 9efa432
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 77 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@3.2.4
* **Fixed:** `Notiflix.Block.*`: The temporary position class name for the reference element has been changed to a constant text.
- Fixes => [#47](https://github.com/notiflix/Notiflix/issues/47)

---

@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)
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
[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].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
[size-badge]: https://img.badgesize.io/https://cdn.jsdelivr.net/npm/[email protected].4/dist/notiflix-aio-3.2.4.min.js?compression=gzip
[size-url]: https://cdn.jsdelivr.net/npm/[email protected].4/dist/notiflix-aio-3.2.4.min.js
[lic-badge]: https://img.shields.io/github/license/notiflix/Notiflix.svg
[lic-url]: https://github.com/notiflix/Notiflix/blob/main/LICENSE

Expand All @@ -36,7 +36,7 @@ Notiflix is a JavaScript library for client-side non-blocking notifications, pop

### Current Version

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

### Browser Compatibility

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

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

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

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

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

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

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

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

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

---------
Expand Down
25 changes: 12 additions & 13 deletions build/notiflix-aio.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Notiflix AIO (https://notiflix.github.io)
* Description: This file has been created automatically that using "notiflix.js", and "notiflix.css" files.
* Version: 3.2.3
* Version: 3.2.4
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/
Expand Down Expand Up @@ -1567,7 +1567,7 @@
// if cssAnimaion is false => duration: end

// check the class name: begin
var blockClassName = 'notiflix-block';
var blockClassName = blockSettings.className;
if (typeof newBlockSettings.className === 'string') {
blockClassName = newBlockSettings.className.trim();
}
Expand All @@ -1578,6 +1578,9 @@
var checkQueryLimit = (allHTMLElements || []).length >= getQueryLimit ? getQueryLimit : allHTMLElements.length;
// check query limit: end

// position class name for the non-static reference elements
var positionClassForNonStaticRef = 'nx-block-temporary-position';

// block
if (isCreate) {
// void and unavailable elements
Expand Down Expand Up @@ -1690,15 +1693,15 @@

// create and add internal style to the head
var style = '<style id="Style-' + blockSettings.ID + '-' + blockCreateOrRemoveCounter + '">' +
eachElementIdOrClass + '.' + blockClassName + '-position{' + positionStyle + minHeightStyle + '}' +
eachElementIdOrClass + '.' + positionClassForNonStaticRef + '{' + positionStyle + minHeightStyle + '}' +
'</style>';
var styleRange = window.document.createRange();
styleRange.selectNode(window.document.head);
var styleFragment = styleRange.createContextualFragment(style);
window.document.head.appendChild(styleFragment);

// add the "blockClassName" to each element
eachElement.classList.add(blockClassName + '-position');
// add the "positionClassForNonStaticRef" to each element
eachElement.classList.add(positionClassForNonStaticRef);
}
// internal style: end

Expand Down Expand Up @@ -1760,11 +1763,10 @@
// Step 2A => Remove each block element: end

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

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

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

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

Expand Down
25 changes: 12 additions & 13 deletions build/notiflix-block-aio.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* 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.3
* Version: 3.2.4
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/
Expand Down Expand Up @@ -281,7 +281,7 @@
// if cssAnimaion is false => duration: end

// check the class name: begin
var blockClassName = 'notiflix-block';
var blockClassName = blockSettings.className;
if (typeof newBlockSettings.className === 'string') {
blockClassName = newBlockSettings.className.trim();
}
Expand All @@ -292,6 +292,9 @@
var checkQueryLimit = (allHTMLElements || []).length >= getQueryLimit ? getQueryLimit : allHTMLElements.length;
// check query limit: end

// position class name for the non-static reference elements
var positionClassForNonStaticRef = 'nx-block-temporary-position';

// block
if (isCreate) {
// void and unavailable elements
Expand Down Expand Up @@ -404,15 +407,15 @@

// create and add internal style to the head
var style = '<style id="Style-' + blockSettings.ID + '-' + blockCreateOrRemoveCounter + '">' +
eachElementIdOrClass + '.' + blockClassName + '-position{' + positionStyle + minHeightStyle + '}' +
eachElementIdOrClass + '.' + positionClassForNonStaticRef + '{' + positionStyle + minHeightStyle + '}' +
'</style>';
var styleRange = window.document.createRange();
styleRange.selectNode(window.document.head);
var styleFragment = styleRange.createContextualFragment(style);
window.document.head.appendChild(styleFragment);

// add the "blockClassName" to each element
eachElement.classList.add(blockClassName + '-position');
// add the "positionClassForNonStaticRef" to each element
eachElement.classList.add(positionClassForNonStaticRef);
}
// internal style: end

Expand Down Expand Up @@ -474,11 +477,10 @@
// Step 2A => Remove each block element: end

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion build/notiflix-confirm-aio.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* 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.3
* Version: 3.2.4
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/
Expand Down
2 changes: 1 addition & 1 deletion build/notiflix-loading-aio.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* 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.3
* Version: 3.2.4
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/
Expand Down
2 changes: 1 addition & 1 deletion build/notiflix-notify-aio.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* 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.3
* Version: 3.2.4
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/
Expand Down
2 changes: 1 addition & 1 deletion build/notiflix-report-aio.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* 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.3
* Version: 3.2.4
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/notiflix-3.2.3.min.js → dist/notiflix-3.2.4.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.

16 changes: 8 additions & 8 deletions docs/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,16 @@
<!-- <script src="../build/notiflix-block-aio.js"></script> -->


<!-- <link href="../dist/notiflix-3.2.3.min.css" rel="stylesheet" /> -->
<!-- <script src="../dist/notiflix-3.2.3.min.js"></script> -->
<!-- <link href="../dist/notiflix-3.2.4.min.css" rel="stylesheet" /> -->
<!-- <script src="../dist/notiflix-3.2.4.min.js"></script> -->

<!-- <script src="../dist/notiflix-aio-3.2.3.min.js"></script> -->
<!-- <script src="../dist/notiflix-aio-3.2.4.min.js"></script> -->

<script src="../dist/notiflix-notify-aio-3.2.3.min.js"></script>
<script src="../dist/notiflix-report-aio-3.2.3.min.js"></script>
<script src="../dist/notiflix-confirm-aio-3.2.3.min.js"></script>
<script src="../dist/notiflix-loading-aio-3.2.3.min.js"></script>
<script src="../dist/notiflix-block-aio-3.2.3.min.js"></script>
<script src="../dist/notiflix-notify-aio-3.2.4.min.js"></script>
<script src="../dist/notiflix-report-aio-3.2.4.min.js"></script>
<script src="../dist/notiflix-confirm-aio-3.2.4.min.js"></script>
<script src="../dist/notiflix-loading-aio-3.2.4.min.js"></script>
<script src="../dist/notiflix-block-aio-3.2.4.min.js"></script>


<script>
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Notiflix (https://notiflix.github.io)
* Version: 3.2.3
* Version: 3.2.4
* Description: TypeScript Declaration.
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "notiflix",
"main": "dist/notiflix-aio-3.2.3.min.js",
"main": "dist/notiflix-aio-3.2.4.min.js",
"types": "index.d.ts",
"version": "3.2.3",
"version": "3.2.4",
"description": "Notiflix is a JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more...",
"homepage": "https://github.com/notiflix/Notiflix",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/notiflix.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Notiflix (https://notiflix.github.io)
* Version: 3.2.3
* Version: 3.2.4
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/
Expand Down
25 changes: 12 additions & 13 deletions src/notiflix.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Notiflix (https://notiflix.github.io)
* Version: 3.2.3
* Version: 3.2.4
* Author: Furkan MT (https://github.com/furcan)
* Copyright 2019 - 2022 Notiflix, MIT Licence (https://opensource.org/licenses/MIT)
*/
Expand Down Expand Up @@ -1571,7 +1571,7 @@
// if cssAnimaion is false => duration: end

// check the class name: begin
var blockClassName = 'notiflix-block';
var blockClassName = blockSettings.className;
if (typeof newBlockSettings.className === 'string') {
blockClassName = newBlockSettings.className.trim();
}
Expand All @@ -1582,6 +1582,9 @@
var checkQueryLimit = (allHTMLElements || []).length >= getQueryLimit ? getQueryLimit : allHTMLElements.length;
// check query limit: end

// position class name for the non-static reference elements
var positionClassForNonStaticRef = 'nx-block-temporary-position';

// block
if (isCreate) {
// void and unavailable elements
Expand Down Expand Up @@ -1694,15 +1697,15 @@

// create and add internal style to the head
var style = '<style id="Style-' + blockSettings.ID + '-' + blockCreateOrRemoveCounter + '">' +
eachElementIdOrClass + '.' + blockClassName + '-position{' + positionStyle + minHeightStyle + '}' +
eachElementIdOrClass + '.' + positionClassForNonStaticRef + '{' + positionStyle + minHeightStyle + '}' +
'</style>';
var styleRange = window.document.createRange();
styleRange.selectNode(window.document.head);
var styleFragment = styleRange.createContextualFragment(style);
window.document.head.appendChild(styleFragment);

// add the "blockClassName" to each element
eachElement.classList.add(blockClassName + '-position');
// add the "positionClassForNonStaticRef" to each element
eachElement.classList.add(positionClassForNonStaticRef);
}
// internal style: end

Expand Down Expand Up @@ -1764,11 +1767,10 @@
// Step 2A => Remove each block element: end

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

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

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

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

Expand Down

0 comments on commit 9efa432

Please sign in to comment.