From 541dadb2872690876c3ca7c79d567881558327e2 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 31 Jan 2016 16:57:07 +0000 Subject: Pass arguments to modes' onExit handlers. --- content_scripts/mode.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index c7c6bd55..5cc8800e 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -187,12 +187,12 @@ class Mode onExit: (handler) -> @exitHandlers.push handler - exit: -> + exit: (args...) -> if @modeIsActive @log "deactivate:", @id unless @modeIsExiting @modeIsExiting = true - handler() for handler in @exitHandlers + handler args... for handler in @exitHandlers handlerStack.remove handlerId for handlerId in @handlers Mode.modes = Mode.modes.filter (mode) => mode != @ @modeIsActive = false -- cgit v1.2.3