Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcarlos committed Jun 14, 2021
1 parent 122c2d6 commit fe26498
Show file tree
Hide file tree
Showing 6 changed files with 315 additions and 386 deletions.
13 changes: 9 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,20 @@ function activate(
tracker.currentWidget !== null &&
tracker.currentWidget === app.shell.currentWidget,
execute: () => {
const cwd = browserFactory.defaultBrowser.model.path;
const wdg = app.shell.currentWidget as DrawIODocumentWidget;
const name = wdg.context.path.split('/').pop().split('.')[0] + ".svg";
let path = wdg.context.path.split('/').slice(0, -1).join();

commands
.execute('docmanager:new-untitled', {
path: cwd,
name,
path,
type: 'file',
ext: '.svg'
})
.then(model => {
const wdg = app.shell.currentWidget as any;
.then( model => {
model.name = name
model.path = path ? path + "/" + name : name;
model.content = wdg.getSVG();
model.format = 'text';
app.serviceManager.contents.save(model.path, model);
Expand Down
Loading

0 comments on commit fe26498

Please sign in to comment.