bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/service.js
2016-07-15 13:50:03 -07:00

41 lines
877 B
JavaScript
Executable File

import Presentations from '/imports/api/presentations';
import Shapes from '/imports/api/shapes';
import Slides from '/imports/api/slides';
import Cursor from '/imports/api/cursor';
let getWhiteboardData = () => {
let currentSlide;
let shapes;
let cursor;
let currentPresentation = Presentations.findOne({
'presentation.current': true,
});
if (currentPresentation != null) {
currentSlide = Slides.findOne({
presentationId: currentPresentation.presentation.id,
'slide.current': true,
});
}
if (currentSlide != null) {
shapes = Shapes.find({
whiteboardId: currentSlide.slide.id,
}).fetch();
cursor = Cursor.find({
meetingId: currentSlide.meetingId,
}).fetch();
}
return {
currentSlide: currentSlide,
shapes: shapes,
cursor: cursor,
};
};
export default {
getWhiteboardData,
};