Created
June 10, 2016 10:24
-
-
Save Pan-Maciek/15ce1d56185f48dc13f4952e2621b596 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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