@4i/modal-manager 1.0.30 → 1.0.31
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/package.json
CHANGED
package/readme.md
CHANGED
@@ -19,6 +19,10 @@ npm install @4i/modal-manager
|
|
19
19
|
|
20
20
|
create table with methods
|
21
21
|
|
22
|
+
onOpenModalState(callback: (state: boolean) => void) {
|
23
|
+
callback(this.queue.length > 0);
|
24
|
+
}
|
25
|
+
|
22
26
|
| Method | Description |
|
23
27
|
| ------------------------------------ | ----------------------------------------------------- |
|
24
28
|
| call(action, props) | Call a modal by its action name and pass props to it. |
|
@@ -31,7 +35,7 @@ create table with methods
|
|
31
35
|
| |
|
32
36
|
| close() | Close last modals. (default) |
|
33
37
|
| |
|
34
|
-
|
|
38
|
+
| onOpenModalState(callback) | Is there at least one window open now |
|
35
39
|
| |
|
36
40
|
| addEventListener(event, callback) | Add an event listener to the modal manager. |
|
37
41
|
| |
|
@@ -8,7 +8,7 @@ declare class ModalManager extends Manager {
|
|
8
8
|
}): void;
|
9
9
|
call<T>(name: string, data?: T): void;
|
10
10
|
close<T>(position?: T): void;
|
11
|
-
|
11
|
+
onOpenModalState(callback: (state: boolean) => void): void;
|
12
12
|
}
|
13
13
|
declare const modal: ModalManager;
|
14
14
|
export default modal;
|
@@ -49,13 +49,9 @@ var ModalManager = /** @class */ (function (_super) {
|
|
49
49
|
this.emitter.emit(constants.CLOSE, position);
|
50
50
|
this.queue.pop();
|
51
51
|
};
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
},
|
56
|
-
enumerable: false,
|
57
|
-
configurable: true
|
58
|
-
});
|
52
|
+
ModalManager.prototype.onOpenModalState = function (callback) {
|
53
|
+
callback(this.queue.length > 0);
|
54
|
+
};
|
59
55
|
return ModalManager;
|
60
56
|
}(Manager_1.default));
|
61
57
|
var modal = new ModalManager();
|