mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Create WeakMap on element creation to support ‘context’ attribute change
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
class StylesElement extends HTMLElement
|
||||
createdCallback: ->
|
||||
@emitter = new Emitter
|
||||
@styleElementClonesByOriginalElement = new WeakMap
|
||||
@context = @getAttribute('context') ? undefined
|
||||
|
||||
attributeChangedCallback: (attrName, oldVal, newVal) ->
|
||||
@@ -19,7 +20,6 @@ class StylesElement extends HTMLElement
|
||||
|
||||
attachedCallback: ->
|
||||
@subscriptions = new CompositeDisposable
|
||||
@styleElementClonesByOriginalElement = new WeakMap
|
||||
@subscriptions.add atom.styles.observeStyleElements(@styleElementAdded.bind(this))
|
||||
@subscriptions.add atom.styles.onDidRemoveStyleElement(@styleElementRemoved.bind(this))
|
||||
@subscriptions.add atom.styles.onDidUpdateStyleElement(@styleElementUpdated.bind(this))
|
||||
|
||||
Reference in New Issue
Block a user