2017-03-17 22:23:00 +08:00
|
|
|
import Breakouts from '/imports/api/breakouts';
|
2017-03-29 02:41:48 +08:00
|
|
|
import Settings from '/imports/ui/services/settings';
|
2017-04-13 03:29:47 +08:00
|
|
|
import Auth from '/imports/ui/services/auth/index.js';
|
2016-05-11 03:39:01 +08:00
|
|
|
|
2017-03-17 03:57:45 +08:00
|
|
|
let currentModal = {
|
|
|
|
component: null,
|
|
|
|
tracker: new Tracker.Dependency,
|
|
|
|
};
|
2016-09-01 21:56:41 +08:00
|
|
|
|
|
|
|
const getModal = () => {
|
2017-03-17 03:57:45 +08:00
|
|
|
currentModal.tracker.depend();
|
|
|
|
return currentModal.component;
|
2016-09-01 21:56:41 +08:00
|
|
|
};
|
|
|
|
|
2017-03-17 03:57:45 +08:00
|
|
|
const showModal = (component) => {
|
|
|
|
if (currentModal.component !== component) {
|
|
|
|
currentModal.component = component;
|
|
|
|
currentModal.tracker.changed();
|
2016-09-01 21:56:41 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-09-22 03:18:13 +08:00
|
|
|
const clearModal = () => {
|
2016-09-07 23:00:52 +08:00
|
|
|
showModal(null);
|
|
|
|
};
|
|
|
|
|
2017-02-25 04:19:53 +08:00
|
|
|
const getCaptionsStatus = () => {
|
2017-04-06 19:46:15 +08:00
|
|
|
const ccSettings = Settings.cc;
|
|
|
|
return ccSettings ? ccSettings.enabled : false;
|
2016-12-23 08:44:31 +08:00
|
|
|
};
|
|
|
|
|
2017-02-25 04:19:53 +08:00
|
|
|
const getFontSize = () => {
|
2017-04-06 19:46:15 +08:00
|
|
|
const applicationSettings = Settings.application;
|
|
|
|
return applicationSettings ? applicationSettings.fontSize : '16px';
|
2016-12-23 08:44:31 +08:00
|
|
|
};
|
|
|
|
|
2017-03-17 22:23:00 +08:00
|
|
|
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 {
|
2016-09-01 21:56:41 +08:00
|
|
|
getModal,
|
|
|
|
showModal,
|
2016-09-07 23:00:52 +08:00
|
|
|
clearModal,
|
2016-12-23 08:44:31 +08:00
|
|
|
getCaptionsStatus,
|
2017-02-25 04:19:53 +08:00
|
|
|
getFontSize,
|
2017-03-15 04:57:22 +08:00
|
|
|
meetingIsBreakout,
|
2016-05-12 23:41:51 +08:00
|
|
|
};
|