MCPcopy Index your code
hub / github.com/nwutils/nw-sample-apps / connect

Function connect

mini-code-edit/cm/lib/codemirror.js:2861–2871  ·  view source on GitHub ↗
(node, type, handler, disconnect)

Source from the content-addressed store, hash-verified

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;}

Callers 4

CodeMirrorFunction · 0.85
onMouseDownFunction · 0.85
onContextMenuFunction · 0.85
codemirror.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected