summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-07-30 09:40:31 +0200
committerjmoenig <jens@moenig.org>2014-07-30 09:40:31 +0200
commitb2399309e4f207d44f57c73f7a92c60f16c9d3ca (patch)
tree1f9c8b92d74e61c009fc9be5b8297937078c219e
parentbfdbeca146f8d58e1f15b2b85f4feae2687d1d9f (diff)
downloadsnap-yow-b2399309e4f207d44f57c73f7a92c60f16c9d3ca.tar.gz
snap-yow-b2399309e4f207d44f57c73f7a92c60f16c9d3ca.zip
propagate HIDE and SHOW to nested sprite parts
-rwxr-xr-xhistory.txt4
-rw-r--r--objects.js19
2 files changed, 22 insertions, 1 deletions
diff --git a/history.txt b/history.txt
index 0568bda..6bb4137 100755
--- a/history.txt
+++ b/history.txt
@@ -2250,3 +2250,7 @@ ______
* updated German translation
* Morphic: fixed #497 (prevent bubble shadows from getting cut-off)
* Blocks: keep result-bubbles within the enclosing scripting pane
+
+140730
+------
+* Objects: propagate HIDE and SHOW to nested sprite parts
diff --git a/objects.js b/objects.js
index c4c4eb8..fbb9e84 100644
--- a/objects.js
+++ b/objects.js
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2014-July-29';
+modules.objects = '2014-July-30';
var SpriteMorph;
var StageMorph;
@@ -2708,6 +2708,23 @@ SpriteMorph.prototype.removeClone = function () {
// SpriteMorph primitives
+// SpriteMorph hiding and showing:
+
+/*
+ override the inherited behavior to also hide/show all
+ nested parts.
+*/
+
+SpriteMorph.prototype.hide = function () {
+ SpriteMorph.uber.hide.call(this);
+ this.parts.forEach(function (part) {part.hide(); });
+};
+
+SpriteMorph.prototype.show = function () {
+ SpriteMorph.uber.show.call(this);
+ this.parts.forEach(function (part) {part.show(); });
+};
+
// SpriteMorph pen color
SpriteMorph.prototype.setColor = function (aColor) {