File tree Expand file tree Collapse file tree 6 files changed +312
-475
lines changed Expand file tree Collapse file tree 6 files changed +312
-475
lines changed Original file line number Diff line number Diff line change @@ -157,15 +157,20 @@ function activate(
157
157
tracker . currentWidget !== null &&
158
158
tracker . currentWidget === app . shell . currentWidget ,
159
159
execute : ( ) => {
160
- const cwd = browserFactory . defaultBrowser . model . path ;
160
+ const wdg = app . shell . currentWidget as DrawIODocumentWidget ;
161
+ const name = wdg . context . path . split ( '/' ) . pop ( ) . split ( '.' ) [ 0 ] + ".svg" ;
162
+ let path = wdg . context . path . split ( '/' ) . slice ( 0 , - 1 ) . join ( ) ;
163
+
161
164
commands
162
165
. execute ( 'docmanager:new-untitled' , {
163
- path : cwd ,
166
+ name,
167
+ path,
164
168
type : 'file' ,
165
169
ext : '.svg'
166
170
} )
167
- . then ( model => {
168
- const wdg = app . shell . currentWidget as any ;
171
+ . then ( model => {
172
+ model . name = name
173
+ model . path = path ? path + "/" + name : name ;
169
174
model . content = wdg . getSVG ( ) ;
170
175
model . format = 'text' ;
171
176
app . serviceManager . contents . save ( model . path , model ) ;
You can’t perform that action at this time.
0 commit comments