Merge pull request #2897 from oswaldoacauan/master
Work on HTML5 client bug when deleting a presentation.
This commit is contained in:
commit
2c782f52dd
@ -60,9 +60,7 @@ Handlebars.registerHelper "getCurrentMeeting", ->
|
||||
Meteor.Meetings.findOne()
|
||||
|
||||
Handlebars.registerHelper "getCurrentSlide", ->
|
||||
currentPresentation = Meteor.Presentations.findOne({"presentation.current": true})
|
||||
presentationId = currentPresentation?.presentation?.id
|
||||
Meteor.Slides.find({"presentationId": presentationId, "slide.current": true})
|
||||
getCurrentSlideDoc()
|
||||
|
||||
# Allow access through all templates
|
||||
Handlebars.registerHelper "getInSession", (k) -> SessionAmplify.get k
|
||||
|
@ -16,7 +16,7 @@ Meteor.startup ->
|
||||
loadLib('bbblogger.js')
|
||||
|
||||
@SessionAmplify = _.extend({}, Session,
|
||||
keys: _.object(_.map(amplify.store(), (value, key) ->
|
||||
keys: _.object(_.map(amplify.store.sessionStorage(), (value, key) ->
|
||||
[
|
||||
key
|
||||
JSON.stringify(value)
|
||||
@ -24,7 +24,7 @@ Meteor.startup ->
|
||||
))
|
||||
set: (key, value) ->
|
||||
Session.set.apply this, arguments
|
||||
amplify.store key, value
|
||||
amplify.store.sessionStorage key, value
|
||||
return
|
||||
)
|
||||
#
|
||||
|
@ -1,5 +1,6 @@
|
||||
Template.slide.rendered = ->
|
||||
currentSlide = getCurrentSlideDoc()
|
||||
|
||||
pic = new Image()
|
||||
pic.onload = ->
|
||||
setInSession 'slideOriginalWidth', this.width
|
||||
@ -21,7 +22,6 @@ Template.slide.rendered = ->
|
||||
@displaySlide = (wpm) ->
|
||||
currentSlide = getCurrentSlideDoc()
|
||||
|
||||
|
||||
wpm.create()
|
||||
adjustedDimensions = scaleSlide(getInSession('slideOriginalWidth'), getInSession('slideOriginalHeight'))
|
||||
wpm._displayPage(currentSlide?.slide?.img_uri, getInSession('slideOriginalWidth'), getInSession('slideOriginalHeight'))
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template name="whiteboard">
|
||||
<div id="{{id}}" {{visibility name}} class="component">
|
||||
{{#each getCurrentSlide}}
|
||||
{{> slide}}
|
||||
{{/each}}
|
||||
{{#if getCurrentSlide}}
|
||||
{{> slide getCurrentSlide}}
|
||||
{{/if}}
|
||||
<div id="whiteboard-container" class="{{whiteboardSize}}">
|
||||
<div id="whiteboard-paper">
|
||||
</div>
|
||||
|
@ -78,6 +78,7 @@ Meteor.methods
|
||||
if meetingId? and presentationId? and Meteor.Presentations.findOne({meetingId: meetingId, "presentation.id": presentationId})?
|
||||
id = Meteor.Presentations.findOne({meetingId: meetingId, "presentation.id": presentationId})
|
||||
if id?
|
||||
Meteor.Slides.remove({presentationId: presentationId}, Meteor.log.info "cleared Slides Collection (presentationId: #{presentationId}!")
|
||||
Meteor.Presentations.remove(id._id)
|
||||
Meteor.log.info "----removed presentation[" + presentationId + "] from " + meetingId
|
||||
|
||||
|
@ -355,6 +355,13 @@ Meteor.startup ->
|
||||
displayThisSlide meetingId, newSlide?.id, newSlide
|
||||
callback()
|
||||
|
||||
# for now not handling this serially #TODO
|
||||
else if eventName is "presentation_removed_message"
|
||||
presentationId = message.payload.presentation_id
|
||||
meetingId = message.payload.meeting_id
|
||||
removePresentationFromCollection meetingId, presentationId
|
||||
callback()
|
||||
|
||||
# for now not handling this serially #TODO
|
||||
else if eventName is "get_whiteboard_shapes_reply" and message.payload.requester_id is "nodeJSapp"
|
||||
# Create a whiteboard clean status or find one for the current meeting
|
||||
|
Loading…
Reference in New Issue
Block a user