File tree Expand file tree Collapse file tree
frontend/webEditor/src/startUpAgent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,17 +3,24 @@ import { IStartUpAgent } from "./StartUpAgent";
33import { LoadDefaultDiagramAction } from "../serialize/loadDefaultDiagram" ;
44import { inject } from "inversify" ;
55import { LoadFromUrlAction } from "../serialize/LoadUrl" ;
6+ import { LayoutModelAction } from "../layout/command" ;
7+ import { LayoutMethod } from "../layout/layoutMethod" ;
68
79export class LoadDefaultDiagramStartUpAgent implements IStartUpAgent {
810 constructor ( @inject ( TYPES . IActionDispatcher ) private actionDispatcher : ActionDispatcher ) { }
911
1012 run ( ) : void {
1113 const urlParams = new URLSearchParams ( window . location . search ) ;
1214 const fileUrlParameter = urlParams . get ( "file" ) ;
13- this . actionDispatcher . dispatch (
15+ const doLayout = urlParams . get ( "layout" ) === "true" ;
16+ const actions = [
1417 fileUrlParameter != undefined
1518 ? LoadFromUrlAction . create ( fileUrlParameter )
1619 : LoadDefaultDiagramAction . create ( ) ,
17- ) ;
20+ ] ;
21+ if ( doLayout ) {
22+ actions . push ( LayoutModelAction . create ( LayoutMethod . LINES ) ) ;
23+ }
24+ this . actionDispatcher . dispatchAll ( actions ) ;
1825 }
1926}
You can’t perform that action at this time.
0 commit comments