(node, type, handler, disconnect)
| 2859 | // Event handler registration. If disconnect is true, it'll return a |
| 2860 | // function that unregisters the handler. |
| 2861 | function connect(node, type, handler, disconnect) { |
| 2862 | if (typeof node.addEventListener == "function") { |
| 2863 | node.addEventListener(type, handler, false); |
| 2864 | if (disconnect) return function() {node.removeEventListener(type, handler, false);}; |
| 2865 | } |
| 2866 | else { |
| 2867 | var wrapHandler = function(event) {handler(event || window.event);}; |
| 2868 | node.attachEvent("on" + type, wrapHandler); |
| 2869 | if (disconnect) return function() {node.detachEvent("on" + type, wrapHandler);}; |
| 2870 | } |
| 2871 | } |
| 2872 | CodeMirror.connect = connect; |
| 2873 | |
| 2874 | function Delayed() {this.id = null;} |
no outgoing calls
no test coverage detected