bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/app/service.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

import Breakouts from '/imports/api/breakouts';
2017-03-29 02:41:48 +08:00
import Settings from '/imports/ui/services/settings';
import Auth from '/imports/ui/services/auth/index.js';
let currentModal = {
component: null,
tracker: new Tracker.Dependency,
};
const getModal = () => {
currentModal.tracker.depend();
return currentModal.component;
};
const showModal = (component) => {
if (currentModal.component !== component) {
currentModal.component = component;
currentModal.tracker.changed();
}
};
2016-09-22 03:18:13 +08:00
const clearModal = () => {
showModal(null);
};
const getCaptionsStatus = () => {
2017-04-06 19:46:15 +08:00
const ccSettings = Settings.cc;
return ccSettings ? ccSettings.enabled : false;
};
const getFontSize = () => {
2017-04-06 19:46:15 +08:00
const applicationSettings = Settings.application;
return applicationSettings ? applicationSettings.fontSize : '16px';
};
function meetingIsBreakout() {
const breakouts = Breakouts.find().fetch();
return (breakouts && breakouts.some(b => b.breakoutMeetingId === Auth.meetingID));
}
2016-05-13 03:50:02 +08:00
export {
getModal,
showModal,
clearModal,
getCaptionsStatus,
getFontSize,
meetingIsBreakout,
2016-05-12 23:41:51 +08:00
};