summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/javascripts/rectangles/engine/scenery/types/video.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/public/assets/javascripts/rectangles/engine/scenery/types/video.js b/public/assets/javascripts/rectangles/engine/scenery/types/video.js
index e8bc7f7..ef25d8d 100644
--- a/public/assets/javascripts/rectangles/engine/scenery/types/video.js
+++ b/public/assets/javascripts/rectangles/engine/scenery/types/video.js
@@ -10,14 +10,20 @@ Scenery.types.video = Scenery.types.base.extend(function(base){
this.build()
this.bind()
-
+
if (opt.data) {
+ if (opt.wall) {
+ var position = opt.wall.mxToPosition(opt.data.position)
+ opt.index = opt.wall.surface.index_for_x( position.a, 0 )
+ }
+ this.set_wall(opt)
this.deserialize(opt.data)
}
else {
- this.recenter()
+ this.set_wall(opt)
+ this.bounds && this.recenter()
}
- },
+ },
build: function(){
switch (this.media.type) {