Skip to content

Commit e133dc1

Browse files
committed
Merge pull request #1 from santiaago/master
Onchange preview callback
2 parents cd17e54 + bf54368 commit e133dc1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/editor.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Editor {
2929
this._ace.setValue(data, -1);
3030
this._ace.focus();
3131
this.updatePreview();
32+
_ace.getSession().on('change',new js.Callback.many((e,a)=>this.updatePreview()));
3233
}
3334

3435
// worry about waitForAce?
@@ -53,7 +54,7 @@ class Editor {
5354

5455
removePreview() {
5556
while (this._preview_el.children.length > 0) {
56-
this._preview_el.removeChild(this._preview_el.firstChild);
57+
this._preview_el.children.first.remove();
5758
}
5859
}
5960

0 commit comments

Comments
 (0)