@netless/telebox-insider 0.2.12 → 0.2.16
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
|
@@ -427,6 +427,11 @@ export class TeleBoxManager {
|
|
|
427
427
|
box.events.on(TELE_BOX_EVENT.VisualResize, () => {
|
|
428
428
|
this.events.emit(TELE_BOX_MANAGER_EVENT.VisualResize, box);
|
|
429
429
|
});
|
|
430
|
+
box.events.on(TELE_BOX_EVENT.ZIndex, () => {
|
|
431
|
+
if (this.topBox && box.zIndex > this.topBox.zIndex) {
|
|
432
|
+
this.topBox$.setValue(box);
|
|
433
|
+
}
|
|
434
|
+
});
|
|
430
435
|
this.events.emit(TELE_BOX_MANAGER_EVENT.Created, box);
|
|
431
436
|
|
|
432
437
|
return box;
|
|
@@ -473,18 +478,18 @@ export class TeleBoxManager {
|
|
|
473
478
|
const index = this.getBoxIndex(boxOrID);
|
|
474
479
|
if (index >= 0) {
|
|
475
480
|
const boxes = this.boxes.slice();
|
|
476
|
-
const
|
|
481
|
+
const deletedBoxes = boxes.splice(index, 1);
|
|
477
482
|
this.boxes$.setValue(boxes);
|
|
478
483
|
this.focusTopBox();
|
|
479
|
-
|
|
484
|
+
deletedBoxes.forEach((box) => box.destroy());
|
|
480
485
|
if (!skipUpdate) {
|
|
481
486
|
if (this.boxes.length <= 0) {
|
|
482
487
|
this.setMaximized(false);
|
|
483
488
|
this.setMinimized(false);
|
|
484
489
|
}
|
|
485
|
-
this.events.emit(TELE_BOX_MANAGER_EVENT.Removed,
|
|
490
|
+
this.events.emit(TELE_BOX_MANAGER_EVENT.Removed, deletedBoxes);
|
|
486
491
|
}
|
|
487
|
-
return
|
|
492
|
+
return deletedBoxes[0];
|
|
488
493
|
}
|
|
489
494
|
return;
|
|
490
495
|
}
|
|
@@ -643,6 +648,9 @@ export class TeleBoxManager {
|
|
|
643
648
|
if (config.fixRatio != null) {
|
|
644
649
|
box.setFixRatio(config.fixRatio, skipUpdate);
|
|
645
650
|
}
|
|
651
|
+
if (config.zIndex != null) {
|
|
652
|
+
box.setZIndex(config.zIndex);
|
|
653
|
+
}
|
|
646
654
|
if (config.content != null) {
|
|
647
655
|
box.mountContent(config.content);
|
|
648
656
|
}
|