Skip to content

Commit

Permalink
set initial value of text area
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Dec 16, 2012
1 parent 1332ed7 commit 61529f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Expand Up @@ -30,7 +30,7 @@ var R = REdit.prototype


R.text = function text (text) { R.text = function text (text) {
if(!arguments.length) if(!arguments.length)
return this.toJSON() return this.toJSON().join('')


var old = this.toJSON() var old = this.toJSON()
text = split(text) text = split(text)
Expand Down Expand Up @@ -88,5 +88,7 @@ R.wrap = function (ta) {
ta.addEventListener('focus', function () { ta.addEventListener('focus', function () {
ta.selectionStart = ta.selectionEnd = start ta.selectionStart = ta.selectionEnd = start
}) })
ta.value = this.text()

return this return this
} }

0 comments on commit 61529f3

Please sign in to comment.