diff --git a/labs/meteor-client/client/globals.coffee b/labs/meteor-client/client/globals.coffee index da7a44bfdc..48b6401dd6 100755 --- a/labs/meteor-client/client/globals.coffee +++ b/labs/meteor-client/client/globals.coffee @@ -188,7 +188,7 @@ Handlebars.registerHelper "getShapesForSlide", -> presentationId = currentPresentation?.presentation?.id currentSlide = Meteor.Slides.findOne({"presentationId": presentationId, "slide.current": true}) # try to reuse the lines above - Meteor.Shapes.find({whiteboardId: currentSlide?.slide?.id}).fetch() + Meteor.Shapes.find({whiteboardId: currentSlide?.slide?.id}) Handlebars.registerHelper "pointerLocation", -> currentPresentation = Meteor.Presentations.findOne({"presentation.current": true}) diff --git a/labs/meteor-client/client/main.coffee b/labs/meteor-client/client/main.coffee index d02498ec1c..a5f0170493 100755 --- a/labs/meteor-client/client/main.coffee +++ b/labs/meteor-client/client/main.coffee @@ -75,4 +75,3 @@ Meteor.startup -> {isActive:false, name:"Options", class: "optionsChatTab"} ] - @whiteboardPaperModel = new WhiteboardPaperModel('whiteboard-paper') diff --git a/labs/meteor-client/client/views/whiteboard/slide.coffee b/labs/meteor-client/client/views/whiteboard/slide.coffee index 21c55214ac..a4501ac73c 100755 --- a/labs/meteor-client/client/views/whiteboard/slide.coffee +++ b/labs/meteor-client/client/views/whiteboard/slide.coffee @@ -23,6 +23,23 @@ Template.slide.helpers wpm = Template.slide.whiteboardPaperModel wpm?.moveCursor(pointer.x, pointer.y) + manuallyDisplayShapes: -> + currentPresentation = Meteor.Presentations.findOne({"presentation.current": true}) + presentationId = currentPresentation?.presentation?.id + currentSlide = Meteor.Slides.findOne({"presentationId": presentationId, "slide.current": true}) + wpm = Template.slide.whiteboardPaperModel + + shapes = Meteor.Shapes.find({whiteboardId: currentSlide?.slide?.id}).fetch() + for s in shapes + shapeInfo = s.shape?.shape + shapeType = shapeInfo?.type + + for num in [0..3] # the coordinates must be in the range 0 to 1 + shapeInfo.points[num] = shapeInfo.points[num] / 100 + wpm.makeShape(shapeType, shapeInfo) + wpm.updateShape(shapeType, shapeInfo) + + #### SHAPE #### Template.shape.rendered = -> # @data is the shape object coming from the {{#each}} in the html file @@ -36,3 +53,9 @@ Template.shape.rendered = -> wpm.makeShape(shapeType, shapeInfo) wpm.updateShape(shapeType, shapeInfo) +Template.shape.destroyed = -> + wpm = Template.slide.whiteboardPaperModel + wpm.clearShapes() + Template.slide.displaySlide(wpm) + Template.slide.manuallyDisplayShapes() + diff --git a/labs/meteor-client/client/views/whiteboard/whiteboard.html b/labs/meteor-client/client/views/whiteboard/whiteboard.html index 23646e52f5..428f085904 100755 --- a/labs/meteor-client/client/views/whiteboard/whiteboard.html +++ b/labs/meteor-client/client/views/whiteboard/whiteboard.html @@ -2,12 +2,13 @@