(args: any[])
| 386 | } |
| 387 | |
| 388 | private getModalOptions(args: any[]): { view: ViewCommon; options: ShowModalOptions } { |
| 389 | if (args.length === 0) { |
| 390 | throw new Error('showModal without parameters is deprecated. Please call showModal on a view instance instead.'); |
| 391 | } else { |
| 392 | let options: ShowModalOptions = null; |
| 393 | |
| 394 | if (args.length === 2) { |
| 395 | options = <ShowModalOptions>args[1]; |
| 396 | } else { |
| 397 | if (args[0] instanceof ViewCommon) { |
| 398 | console.log('showModal(view: ViewBase, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean) ' + 'is deprecated. Use showModal(view: ViewBase, modalOptions: ShowModalOptions) instead.'); |
| 399 | } else { |
| 400 | console.log('showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean) ' + 'is deprecated. Use showModal(moduleName: string, modalOptions: ShowModalOptions) instead.'); |
| 401 | } |
| 402 | |
| 403 | options = { |
| 404 | context: args[1], |
| 405 | closeCallback: args[2], |
| 406 | fullscreen: args[3], |
| 407 | animated: args[4], |
| 408 | stretched: args[5], |
| 409 | }; |
| 410 | } |
| 411 | |
| 412 | const firstArgument = args[0]; |
| 413 | const view = firstArgument instanceof ViewCommon ? firstArgument : <ViewCommon>Builder.createViewFromEntry({ |
| 414 | moduleName: firstArgument, |
| 415 | }); |
| 416 | |
| 417 | return { view, options }; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | public showModal(...args): ViewType { |
| 422 | const { view, options } = this.getModalOptions(args); |
nothing calls this directly
no test coverage detected