From 679b9e48d6f1567a1193548e7a82fbf4235ac884 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Sat, 1 Jan 2011 13:09:41 -0800 Subject: [PATCH] fixed issue 757 (removeEvents bug) --- src/EventManager.js | 9 +-- tests/issue_757_removeEvents.html | 96 +++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 tests/issue_757_removeEvents.html diff --git a/src/EventManager.js b/src/EventManager.js index 47e98c5..c99b659 100644 --- a/src/EventManager.js +++ b/src/EventManager.js @@ -28,7 +28,6 @@ function EventManager(options, sources) { var currentFetchID = 0; var pendingSourceCnt = 0; var loadingLevel = 0; - var dynamicEventSource = []; var cache = []; @@ -111,7 +110,8 @@ function EventManager(options, sources) { -----------------------------------------------------------------------------*/ - sources.push(dynamicEventSource); + // first event source is reserved for "sticky" events + sources.unshift([]); function addEventSource(source) { @@ -175,8 +175,8 @@ function EventManager(options, sources) { normalizeEvent(event); if (!event.source) { if (stick) { - dynamicEventSource.push(event); - event.source = dynamicEventSource; + sources[0].push(event); + event.source = sources[0]; } cache.push(event); } @@ -205,6 +205,7 @@ function EventManager(options, sources) { for (var i=0; i + + + + + + + + + +
+ +