Fix: minor
This commit is contained in:
		
							parent
							
								
									05a87ed00f
								
							
						
					
					
						commit
						05a6208f5c
					
				|  | @ -1,5 +1,4 @@ | |||
| /* global importScripts workerUtil CSSLint require metaParser */ | ||||
| /* exported editorWorker */ | ||||
| 'use strict'; | ||||
| 
 | ||||
| importScripts('/js/worker-util.js'); | ||||
|  |  | |||
|  | @ -14,10 +14,10 @@ const rerouteHotkeys = (() => { | |||
|     'colorpicker', | ||||
|   ]); | ||||
| 
 | ||||
|   rerouteHotkeys(true); | ||||
| 
 | ||||
|   return rerouteHotkeys; | ||||
| 
 | ||||
|   // note that this function relies on `editor`. Calling this function before
 | ||||
|   // the editor is initialized may throw an error.
 | ||||
|   function rerouteHotkeys(enable, immediately) { | ||||
|     if (!immediately) { | ||||
|       debounce(rerouteHotkeys, 0, enable, true); | ||||
|  | @ -29,9 +29,6 @@ const rerouteHotkeys = (() => { | |||
|   } | ||||
| 
 | ||||
|   function rerouteHandler(event) { | ||||
|     if (typeof editor === 'undefined') { | ||||
|       return; | ||||
|     } | ||||
|     const keyName = CodeMirror.keyName(event); | ||||
|     if (!keyName) { | ||||
|       return; | ||||
|  |  | |||
|  | @ -70,17 +70,21 @@ function createResizeGrip(cm) { | |||
| } | ||||
| 
 | ||||
| function createSection({ | ||||
|   // data model
 | ||||
|   originalSection, | ||||
|   genId, | ||||
|   dirty, | ||||
|   // util
 | ||||
|   nextEditor, | ||||
|   prevEditor, | ||||
|   genId, | ||||
|   // emit events
 | ||||
|   // TODO: better names like `onRemoved`? Or make a real event emitter.
 | ||||
|   showMozillaFormatImport, | ||||
|   removeSection, | ||||
|   insertSectionAfter, | ||||
|   moveSectionUp, | ||||
|   moveSectionDown, | ||||
|   restoreSection, | ||||
|   nextEditor, | ||||
|   prevEditor | ||||
| }) { | ||||
|   const sectionId = genId(); | ||||
|   const el = template.section.cloneNode(true); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user