Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Pan-Maciek/15ce1d56185f48dc13f4952e2621b596 to your computer and use it in GitHub Desktop.
Save Pan-Maciek/15ce1d56185f48dc13f4952e2621b596 to your computer and use it in GitHub Desktop.
var Editor = function(el){
this.element = el
this.cursors = []
this.lines = []
this.creatLine = function (linenum){
var that = this
var el = document.createElement("p")
el.addEventListener("click",function(){
that.lines.push(el)
console.log(that.lines)
return that.lines
},true);
this.element.appendChild(el)
}
}
var edit
window.onload = function(){
edit = new Editor(document.getElementsByClassName("editor")[0])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment