mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Require TextEditorElement eagerly
With snapshots, all the forbidden modules are required lazily. In the
case of `TextEditorElement` this can be problematic because users might
create editors via `document.createElement('atom-text-editor')`.
With this commit we will eagerly require
`src/text-editor-element.coffee`, thus forcing `TextEditorElement` to
register the HTML custom element and fixing the issue.
This commit is contained in:
@@ -196,6 +196,11 @@ class AtomEnvironment extends Model
|
||||
@applicationDelegate.didChangeHistoryManager() unless e.reloaded
|
||||
|
||||
initialize: (params={}) ->
|
||||
# This will force TextEditorElement to register the custom element, so that
|
||||
# using `document.createElement('atom-text-editor')` works if it's called
|
||||
# before opening a buffer.
|
||||
require './text-editor-element'
|
||||
|
||||
{@window, @document, @blobStore, @configDirPath, onlyLoadBaseStyleSheets} = params
|
||||
{devMode, safeMode, resourcePath, clearWindowState} = @getLoadSettings()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user