Revert "don't copy state anymore"

This reverts commit cece44d4ac.
This commit is contained in:
Leo Horie 2016-07-08 10:24:48 -04:00
parent cece44d4ac
commit a988276e9b
4 changed files with 42 additions and 8 deletions

View file

@ -19,9 +19,7 @@ h1,h2,h3,h4,h5,h6,p {margin:0 0 10px;}
var m = require("../../mithril")
var Editor = {
oninit: function() {
this.data = "# Markdown Editor\n\nType on the left panel and see the result on the right panel"
},
data: "# Markdown Editor\n\nType on the left panel and see the result on the right panel",
view: function(vnode) {
return [
m("textarea.editor-input", {oninput: function(e) {vnode.state.data = e.target.value}}, vnode.state.data),

View file

@ -25,9 +25,7 @@ renderer.setEventCallback(run)
var trust = require("../../render/trust")
var Editor = {
oninit: function() {
this.data = "# Markdown Editor\n\nType on the left panel and see the result on the right panel"
},
data: "# Markdown Editor\n\nType on the left panel and see the result on the right panel",
view: function(vnode) {
return [
m("textarea.editor-input", {oninput: function(e) {vnode.state.data = e.target.value}}, vnode.state.data),