bigpipe-util 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/package.json +1 -1
- package/src/core/Dialog.js +22 -18
package/CHANGELOG.md
CHANGED
|
@@ -4,10 +4,15 @@ All notable changes to `bigpipe-util` will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
|
|
6
6
|
|
|
7
|
+
## v0.2.8 - 2025-05-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Added `timeout` to open dialog with a delay in method `showFromModel`
|
|
11
|
+
|
|
7
12
|
## v0.2.7 - 2025-03-22
|
|
8
13
|
|
|
9
14
|
### Added
|
|
10
|
-
- Added `timeout` to open dialog with a delay
|
|
15
|
+
- Added `timeout` to open dialog with a delay in method `render`
|
|
11
16
|
|
|
12
17
|
## v0.2.6 - 2025-01-16
|
|
13
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bigpipe-util",
|
|
3
3
|
"description": "This library currently implements small part of Facebook BigPipe so far, but the advantage is to efficiently insert/replace content and work with the DOM. It is also possible to easily call JavaScript modules from PHP.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.8",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bigpipe",
|
|
7
7
|
"xhr",
|
package/src/core/Dialog.js
CHANGED
|
@@ -8,7 +8,7 @@ let dialogId = 1;
|
|
|
8
8
|
let zIndex;
|
|
9
9
|
let originalBodyPad = null;
|
|
10
10
|
|
|
11
|
-
Modal.prototype._handleKeydownEvent = function(event) {
|
|
11
|
+
Modal.prototype._handleKeydownEvent = function (event) {
|
|
12
12
|
if (event.which === 27 && this._options.keyboard) {
|
|
13
13
|
const currentModal = stack[stack.length - 1];
|
|
14
14
|
if (currentModal.el.isEqualNode(this.el)) {
|
|
@@ -52,9 +52,7 @@ export default class Dialog {
|
|
|
52
52
|
backdropTransition: options.backdropTransition !== null && options.backdropTransition !== undefined ? options.backdropTransition : 0,
|
|
53
53
|
}, options.controller, args);
|
|
54
54
|
|
|
55
|
-
stack.push(dialog);
|
|
56
|
-
|
|
57
|
-
return dialog;
|
|
55
|
+
return stack.push(dialog);
|
|
58
56
|
};
|
|
59
57
|
|
|
60
58
|
if (options.timeout && typeof options.timeout === 'number') {
|
|
@@ -65,20 +63,26 @@ export default class Dialog {
|
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
showFromModel(model, args) {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
const renderDialog = () => {
|
|
67
|
+
const dialog = this._show({
|
|
68
|
+
title: model.title || '',
|
|
69
|
+
content: model.body,
|
|
70
|
+
footer: model.footer || false,
|
|
71
|
+
animate: model.animate !== null && model.animate !== undefined ? model.animate : false,
|
|
72
|
+
keyboard: model.keyboard !== null && model.keyboard !== undefined ? model.keyboard : true,
|
|
73
|
+
backdrop: model.backdrop !== null && model.backdrop !== undefined ? model.backdrop : true,
|
|
74
|
+
transition: model.transition !== null && model.transition !== undefined ? model.transition : 0,
|
|
75
|
+
backdropTransition: model.backdropTransition !== null && model.backdropTransition !== undefined ? model.backdropTransition : 0,
|
|
76
|
+
}, model.controller, args);
|
|
77
|
+
|
|
78
|
+
return stack.push(dialog);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
if (model.timeout && typeof model.timeout === 'number') {
|
|
82
|
+
return new Promise(resolve => setTimeout(() => resolve(renderDialog()), model.timeout));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return renderDialog();
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
_show(options, controller, args) {
|