(node, type, handler, disconnect)
| 3059 | // Event handler registration. If disconnect is true, it'll return a |
| 3060 | // function that unregisters the handler. |
| 3061 | function connect(node, type, handler, disconnect) { |
| 3062 | if (typeof node.addEventListener == "function") { |
| 3063 | node.addEventListener(type, handler, false); |
| 3064 | if (disconnect) return function() {node.removeEventListener(type, handler, false);}; |
| 3065 | } |
| 3066 | else { |
| 3067 | var wrapHandler = function(event) {handler(event || window.event);}; |
| 3068 | node.attachEvent("on" + type, wrapHandler); |
| 3069 | if (disconnect) return function() {node.detachEvent("on" + type, wrapHandler);}; |
| 3070 | } |
| 3071 | } |
| 3072 | CodeMirror.connect = connect; |
| 3073 | |
| 3074 | function Delayed() {this.id = null;} |
no outgoing calls
no test coverage detected