Skip to content

Commit

Permalink
Trying something else
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Oct 23, 2024
1 parent 66163fd commit d230701
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions python/jupytercad_core/src/stlplugin/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export class JupyterCadStlDoc extends JupyterCadDoc {
this._source.observeDeep(this._sourceObserver);
}

setSource(value: string) {
this._source.insert(0, value);
}

get version(): string {
return '0.1.0';
}
Expand Down
3 changes: 2 additions & 1 deletion python/jupytercad_core/src/stlplugin/modelfactory.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { IJupyterCadDoc, JupyterCadModel } from '@jupytercad/schema';
import { DocumentRegistry } from '@jupyterlab/docregistry';
import { Contents } from '@jupyterlab/services';
import { JupyterCadStlDoc } from './model';

class JupyterCadSTLModel extends JupyterCadModel {
fromString(data: string): void {
this.sharedModel.source = data;
(this.sharedModel as JupyterCadStlDoc).setSource(data);
this.dirty = true;
}
}
Expand Down

0 comments on commit d230701

Please sign in to comment.