summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-04-25 18:36:21 +0200
committerjmoenig <jens@moenig.org>2013-04-25 18:36:21 +0200
commit25f813f79ecf367829ce20998d610c426afac07c (patch)
tree9ea3b647e877a58ac4a2b5badf3447a91ce99ebe
parent4580aa1e0d58b4f7f5aa27f5360416d6cc4697d8 (diff)
downloadsnap-25f813f79ecf367829ce20998d610c426afac07c.tar.gz
snap-25f813f79ecf367829ce20998d610c426afac07c.zip
Restore multi-dialog restrictions for multi-world setups
-rwxr-xr-xhistory.txt2
-rw-r--r--morphic.js3
-rw-r--r--widgets.js11
3 files changed, 12 insertions, 4 deletions
diff --git a/history.txt b/history.txt
index b631df5..53204c1 100755
--- a/history.txt
+++ b/history.txt
@@ -1667,3 +1667,5 @@ ______
130425
------
* Objects, Blocks, GUI, Store: Hide primitives feature
+* Morphic: Introducing World.stamp as reference in multi-World setups
+* Widgets: restore multi-dialog restrictions for multi-world setups
diff --git a/morphic.js b/morphic.js
index 590337a..76af43f 100644
--- a/morphic.js
+++ b/morphic.js
@@ -1035,7 +1035,7 @@
/*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio,
FileList, getBlurredShadowSupport*/
-var morphicVersion = '2013-April-21';
+var morphicVersion = '2013-April-25';
var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug
@@ -9885,6 +9885,7 @@ WorldMorph.prototype.init = function (aCanvas, fillPage) {
this.worldCanvas = aCanvas;
// additional properties:
+ this.stamp = Date.now(); // reference in multi-world setups
this.useFillPage = fillPage;
if (this.useFillPage === undefined) {
this.useFillPage = true;
diff --git a/widgets.js b/widgets.js
index 4c720a9..a2e4582 100644
--- a/widgets.js
+++ b/widgets.js
@@ -2043,10 +2043,15 @@ DialogBoxMorph.prototype.withKey = function (key) {
DialogBoxMorph.prototype.popUp = function (world) {
if (world) {
if (this.key) {
- if (this.instances[this.key]) {
- this.instances[this.key].destroy();
+ if (this.instances[world.stamp]) {
+ if (this.instances[world.stamp][this.key]) {
+ this.instances[world.stamp][this.key].destroy();
+ }
+ this.instances[world.stamp][this.key] = this;
+ } else {
+ this.instances[world.stamp] = {};
+ this.instances[world.stamp][this.key] = this;
}
- this.instances[this.key] = this;
}
world.add(this);
world.keyboardReceiver = this;