Restore multi-dialog restrictions for multi-world setups

pull/3/merge
jmoenig 2013-04-25 18:36:21 +02:00
rodzic 4580aa1e0d
commit 25f813f79e
3 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -1667,3 +1667,5 @@ ______
130425 130425
------ ------
* Objects, Blocks, GUI, Store: Hide primitives feature * 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

Wyświetl plik

@ -1035,7 +1035,7 @@
/*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio, /*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio,
FileList, getBlurredShadowSupport*/ FileList, getBlurredShadowSupport*/
var morphicVersion = '2013-April-21'; var morphicVersion = '2013-April-25';
var modules = {}; // keep track of additional loaded modules var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug
@ -9885,6 +9885,7 @@ WorldMorph.prototype.init = function (aCanvas, fillPage) {
this.worldCanvas = aCanvas; this.worldCanvas = aCanvas;
// additional properties: // additional properties:
this.stamp = Date.now(); // reference in multi-world setups
this.useFillPage = fillPage; this.useFillPage = fillPage;
if (this.useFillPage === undefined) { if (this.useFillPage === undefined) {
this.useFillPage = true; this.useFillPage = true;

Wyświetl plik

@ -2043,10 +2043,15 @@ DialogBoxMorph.prototype.withKey = function (key) {
DialogBoxMorph.prototype.popUp = function (world) { DialogBoxMorph.prototype.popUp = function (world) {
if (world) { if (world) {
if (this.key) { if (this.key) {
if (this.instances[this.key]) { if (this.instances[world.stamp]) {
this.instances[this.key].destroy(); 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.add(this);
world.keyboardReceiver = this; world.keyboardReceiver = this;