()
| 8943 | globalsRegistered = true |
| 8944 | } |
| 8945 | function registerGlobalHandlers() { |
| 8946 | // When the window resizes, we need to refresh active editors. |
| 8947 | var resizeTimer |
| 8948 | on(window, "resize", function () { |
| 8949 | if (resizeTimer == null) { |
| 8950 | resizeTimer = setTimeout(function () { |
| 8951 | resizeTimer = null |
| 8952 | forEachCodeMirror(onResize) |
| 8953 | }, 100) |
| 8954 | } |
| 8955 | }) |
| 8956 | // When the window loses focus, we want to show the editor as blurred |
| 8957 | on(window, "blur", function () { |
| 8958 | return forEachCodeMirror(onBlur) |
| 8959 | }) |
| 8960 | } |
| 8961 | // Called when the window resizes |
| 8962 | function onResize(cm) { |
| 8963 | var d = cm.display |
no test coverage detected