X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=common%2Ftextarea.js;h=ec79e0dc84f42599e73bf82026302a1819b34421;hb=401ff9f17c622f3173cc8d34cfcf3e444620d7d0;hp=c3c61bed406f8a3f9e0b020ee42c9c647e7c6602;hpb=760a3285058137f8873a9d69c94f2696b2080f8f;p=dygraphs.git diff --git a/common/textarea.js b/common/textarea.js index c3c61be..ec79e0d 100644 --- a/common/textarea.js +++ b/common/textarea.js @@ -104,7 +104,6 @@ TextArea.prototype.show = function(title, content) { var textarea = this; this.keyDownListener_ = function(event) { - // console.log(event); if(event.keyCode == 13) { // enter / return textarea.hide(); } @@ -113,14 +112,14 @@ TextArea.prototype.show = function(title, content) { } } - Dygraph.addEvent(document, "keydown", this.keyDownListener_); + document.addEventListener("keydown", this.keyDownListener_); this.reposition(); window.addEventListener('resize', this.reposition, false); document.documentElement.addEventListener('onscroll', this.reposition); } TextArea.prototype.hide = function() { - Dygraph.removeEvent(document, "keypress", this.keyDownListener_); + document.removeEventListener('keypress', this.keyDownListener_); this.keyDownListener_ = null; this.elem.style.display = "none"; this.background.style.display = "none";