bigbluebutton-Github/bigbluebutton-html5/imports/api/slides/server/modifiers/displayThisSlide.js

30 lines
941 B
JavaScript
Raw Normal View History

2016-05-13 01:43:59 +08:00
import Slides from '/imports/api/slides/collection';
export function displayThisSlide(meetingId, newSlideId, slideObject) {
let presentationId;
presentationId = newSlideId.split('/')[0]; // grab the presentationId part of the slideId
// change current to false for the old slide
Slides.update({
presentationId: presentationId,
'slide.current': true,
}, {
$set: {
'slide.current': false,
},
});
//change current to true for the new slide and update its ratios and offsets
Slides.update({
presentationId: presentationId,
'slide.id': newSlideId,
}, {
$set: {
'slide.current': true,
'slide.height_ratio': slideObject.height_ratio,
'slide.width_ratio': slideObject.width_ratio,
'slide.x_offset': slideObject.x_offset,
'slide.y_offset': slideObject.y_offset,
},
});
};