@@ -225,10 +225,10 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
225225 const animated = arguments [ 4 ] ;
226226 const stretched = arguments [ 5 ] ;
227227
228- const view : ViewDefinition = firstAgrument instanceof ViewCommon
229- ? firstAgrument : createViewFromEntry ( { moduleName : firstAgrument } ) ;
228+ const view = firstAgrument instanceof ViewCommon
229+ ? firstAgrument : < ViewCommon > createViewFromEntry ( { moduleName : firstAgrument } ) ;
230230
231- ( < ViewCommon > view ) . _showNativeModalView ( this , context , closeCallback , fullscreen , animated , stretched ) ;
231+ view . _showNativeModalView ( this , context , closeCallback , fullscreen , animated , stretched ) ;
232232 return view ;
233233 }
234234 }
@@ -256,27 +256,29 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
256256 this . _modalParent = parent ;
257257 this . _modalContext = context ;
258258 const that = this ;
259- this . _closeModalCallback = function ( ) {
259+ this . _closeModalCallback = function ( ... originalArgs ) {
260260 if ( that . _closeModalCallback ) {
261261 const modalIndex = _rootModalViews . indexOf ( that ) ;
262262 _rootModalViews . splice ( modalIndex ) ;
263- that . _hideNativeModalView ( parent ) ;
264- that . _modalParent = null ;
265- that . _modalContext = null ;
266- that . _closeModalCallback = null ;
267- that . _dialogClosed ( ) ;
268- parent . _modal = null ;
269-
270- if ( typeof closeCallback === "function" ) {
271- closeCallback . apply ( undefined , arguments ) ;
263+
264+ const whenClosedCallback = ( ) => {
265+ that . _modalParent = null ;
266+ that . _modalContext = null ;
267+ that . _closeModalCallback = null ;
268+ that . _dialogClosed ( ) ;
269+ parent . _modal = null ;
270+
271+ if ( typeof closeCallback === "function" ) {
272+ closeCallback . apply ( undefined , originalArgs ) ;
273+ }
272274 }
275+
276+ that . _hideNativeModalView ( parent , whenClosedCallback ) ;
273277 }
274278 } ;
275279 }
276280
277- protected _hideNativeModalView ( parent : ViewCommon ) {
278- //
279- }
281+ protected abstract _hideNativeModalView ( parent : ViewCommon , whenClosedCallback : ( ) => void ) ;
280282
281283 protected _raiseLayoutChangedEvent ( ) {
282284 const args : EventData = {
0 commit comments