bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/annotations/text/service.js

31 lines
800 B
JavaScript
Raw Normal View History

import Storage from '/imports/ui/services/storage/session';
2017-09-21 05:05:17 +08:00
const DRAW_SETTINGS = 'drawSettings';
const setTextShapeValue = (text) => {
2017-09-21 05:05:17 +08:00
const drawSettings = Storage.getItem(DRAW_SETTINGS);
if (drawSettings) {
drawSettings.textShape.textShapeValue = text;
2017-09-21 05:05:17 +08:00
Storage.setItem(DRAW_SETTINGS, drawSettings);
}
};
const resetTextShapeActiveId = () => {
2017-09-21 05:05:17 +08:00
const drawSettings = Storage.getItem(DRAW_SETTINGS);
if (drawSettings) {
drawSettings.textShape.textShapeActiveId = '';
2017-09-21 05:05:17 +08:00
Storage.setItem(DRAW_SETTINGS, drawSettings);
}
};
const activeTextShapeId = () => {
2017-09-21 05:05:17 +08:00
const drawSettings = Storage.getItem(DRAW_SETTINGS);
return drawSettings ? drawSettings.textShape.textShapeActiveId : '';
};
export default {
setTextShapeValue,
activeTextShapeId,
resetTextShapeActiveId,
};