mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Dispose of subscriptions on SpacePen views in callRemoveHooks
Fixes atom/bracket-matcher#75
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
"season": "^1.0.2",
|
||||
"semver": "1.1.4",
|
||||
"serializable": "^1",
|
||||
"space-pen": "3.7.0",
|
||||
"space-pen": "3.8.0",
|
||||
"temp": "0.7.0",
|
||||
"text-buffer": "^3.2.8",
|
||||
"theorist": "^1.0.2",
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
_ = require 'underscore-plus'
|
||||
spacePen = require 'space-pen'
|
||||
SpacePen = require 'space-pen'
|
||||
{Subscriber} = require 'emissary'
|
||||
|
||||
Subscriber.includeInto(spacePen.View)
|
||||
Subscriber.includeInto(SpacePen.View)
|
||||
|
||||
jQuery = spacePen.jQuery
|
||||
jQuery = SpacePen.jQuery
|
||||
JQueryCleanData = jQuery.cleanData
|
||||
jQuery.cleanData = (elements) ->
|
||||
jQuery(element).view()?.unsubscribe() for element in elements
|
||||
JQueryCleanData(elements)
|
||||
|
||||
SpacePenCallRemoveHooks = SpacePen.callRemoveHooks
|
||||
SpacePen.callRemoveHooks = (element) ->
|
||||
view.unsubscribe() for view in SpacePen.viewsForElement(element)
|
||||
SpacePenCallRemoveHooks(element)
|
||||
|
||||
NativeEventNames = new Set
|
||||
NativeEventNames.add(nativeEvent) for nativeEvent in ["blur", "focus", "focusin",
|
||||
"focusout", "load", "resize", "scroll", "unload", "click", "dblclick", "mousedown",
|
||||
@@ -133,4 +138,4 @@ jQuery.fn.setTooltip.humanizeKeystrokes = humanizeKeystrokes
|
||||
|
||||
Object.defineProperty jQuery.fn, 'element', get: -> @[0]
|
||||
|
||||
module.exports = spacePen
|
||||
module.exports = SpacePen
|
||||
|
||||
Reference in New Issue
Block a user