[view] popup: add onShow and onClose methods
This commit is contained in:
@@ -30,7 +30,7 @@ class DefaultLayout extends Layout {
|
||||
placeViewVertical(group, view);
|
||||
false;
|
||||
case LAYOUT:
|
||||
true;
|
||||
view.visible;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -45,14 +45,20 @@ class PopupView<R> extends GroupView {
|
||||
return this.view;
|
||||
}
|
||||
|
||||
private function onShow():Void {}
|
||||
|
||||
private function onClose():Void {}
|
||||
|
||||
public function show():Promise<R> {
|
||||
manager.show(this);
|
||||
deferred = new Deferred<R>();
|
||||
onShow();
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
public function close(result:R):Void {
|
||||
manager.close(this);
|
||||
onClose();
|
||||
if (deferred != null) {
|
||||
deferred.resolve(result);
|
||||
deferred = null;
|
||||
|
||||
Reference in New Issue
Block a user