diff options
| author | Nathan Dinsmore <queryselector@gmail.com> | 2013-04-21 13:53:39 -0400 |
|---|---|---|
| committer | Nathan Dinsmore <queryselector@gmail.com> | 2013-04-21 14:45:51 -0400 |
| commit | cad54f7433f48a016f3ebc8ae37a6fe75090bcfb (patch) | |
| tree | 024cb87decb2a244b46e6e1fe8869041f4adedd9 /byob.js | |
| parent | 977da0314c01ce8d3cda160cb913e12d4a980f36 (diff) | |
| download | snap-yow-cad54f7433f48a016f3ebc8ae37a6fe75090bcfb.tar.gz snap-yow-cad54f7433f48a016f3ebc8ae37a6fe75090bcfb.zip | |
Fixed #23
Only one of each kind of dialog can now be open at any given time.
You can still open multiple dialogs for editing a costume and editing a block.
Diffstat (limited to 'byob.js')
| -rw-r--r-- | byob.js | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -1026,6 +1026,10 @@ BlockDialogMorph.prototype = new DialogBoxMorph(); BlockDialogMorph.prototype.constructor = BlockDialogMorph; BlockDialogMorph.uber = DialogBoxMorph.prototype; +// BlockDialogMorph constants: + +BlockDialogMorph.prototype.key = 'makeABlock'; + // BlockDialogMorph instance creation: function BlockDialogMorph(target, action, environment) { @@ -1099,11 +1103,7 @@ BlockDialogMorph.prototype.openForChange = function ( this.scopes = null; this.fixLayout(); this.drawNew(); - if (world) { - world.add(this); - this.setCenter(world.center()); - this.edit(); - } + this.popUp(world); }; // category buttons @@ -1544,8 +1544,7 @@ BlockEditorMorph.prototype.popUp = function () { var world = this.target.world(); if (world) { - world.add(this); - world.keyboardReceiver = this; + BlockEditorMorph.uber.popUp.call(this, world); this.handle = new HandleMorph( this, 280, @@ -1553,7 +1552,6 @@ BlockEditorMorph.prototype.popUp = function () { this.corner, this.corner ); - this.setCenter(world.center()); } }; @@ -2424,11 +2422,7 @@ InputSlotDialogMorph.prototype.open = function ( this.fixLayout(); this.drawNew(); this.fixLayout(); - if (world) { - world.add(this); - this.setCenter(world.center()); - this.edit(); - } + this.popUp(world); this.add(this.types); // make the types come to front Morph.prototype.trackChanges = oldFlag; this.changed(); @@ -2846,6 +2840,10 @@ BlockExportDialogMorph.prototype = new DialogBoxMorph(); BlockExportDialogMorph.prototype.constructor = BlockExportDialogMorph; BlockExportDialogMorph.uber = DialogBoxMorph.prototype; +// BlockExportDialogMorph constants: + +BlockExportDialogMorph.prototype.key = 'blockExport'; + // BlockExportDialogMorph instance creation: function BlockExportDialogMorph(serializer, blocks) { @@ -2952,8 +2950,7 @@ BlockExportDialogMorph.prototype.buildContents = function () { BlockExportDialogMorph.prototype.popUp = function (wrrld) { var world = wrrld || this.target.world(); if (world) { - world.add(this); - world.keyboardReceiver = this; + BlockExportDialogMorph.uber.popUp.call(this, world); this.handle = new HandleMorph( this, 200, @@ -2961,7 +2958,6 @@ BlockExportDialogMorph.prototype.popUp = function (wrrld) { this.corner, this.corner ); - this.setCenter(world.center()); } }; @@ -3024,6 +3020,10 @@ BlockImportDialogMorph.prototype = new DialogBoxMorph(); BlockImportDialogMorph.prototype.constructor = BlockImportDialogMorph; BlockImportDialogMorph.uber = DialogBoxMorph.prototype; +// BlockImportDialogMorph constants: + +BlockImportDialogMorph.prototype.key = 'blockImport'; + // BlockImportDialogMorph instance creation: function BlockImportDialogMorph(blocks, target, name) { |
