Skip to content

Commit a4085ee

Browse files
committed
Explicitly add PM view object to the public API
1 parent 0e09b06 commit a4085ee

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

script/main.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,18 @@ window.Prosemirror.enableProsemirror = function enableProsemirror() {
3737
plugins,
3838
}),
3939
dispatchTransaction(tr) {
40-
console.log('run');
41-
4240
view.updateState(view.state.apply(tr));
4341

4442
const spaces = 4;
4543
json.value = JSON.stringify(view.state.doc.toJSON(), null, spaces); // FIXME: no need to pretty print this!
4644
},
4745
nodeViews: getNodeViews(),
4846
});
49-
window.view = view;
47+
window.Prosemirror.view = view;
5048
};
5149

5250
window.Prosemirror.destroyProsemirror = function destroyProsemirror() {
53-
if (window.view && typeof window.view.destroy === 'function') {
54-
window.view.destroy();
51+
if (window.Prosemirror.view && typeof window.Prosemirror.view.destroy === 'function') {
52+
window.Prosemirror.view.destroy();
5553
}
5654
};

0 commit comments

Comments
 (0)