commit bd99dd192344a089f5aa1cb7c5d2009881c691ef
parent 8cbaeef2ab8b2f72dd867ae670350266300b688a
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Mon, 21 Nov 2016 00:22:26 +0300
[hash state] notify subscribers when key disappears from hash -- used in panoramas
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/lib/leaflet.hashState/hashState.js b/src/lib/leaflet.hashState/hashState.js
@@ -84,6 +84,13 @@ const hashState = {
changedKeys[key] = 1;
}
}
+
+ for (let key in this._state) {
+ if (! (key in newState)) {
+ changedKeys[key] = 1;
+ }
+ }
+
for (let [key, callback] of this._listeners) {
if (key in changedKeys) {
// setTimeout(callback.bind(null, newState[key]), 0);