2017-06-11 10:21:37 +08:00
|
|
|
import Storage from '/imports/ui/services/storage/session';
|
|
|
|
|
2017-09-21 05:05:17 +08:00
|
|
|
const DRAW_SETTINGS = 'drawSettings';
|
|
|
|
|
2017-06-11 10:21:37 +08:00
|
|
|
const setTextShapeValue = (text) => {
|
2017-09-21 05:05:17 +08:00
|
|
|
const drawSettings = Storage.getItem(DRAW_SETTINGS);
|
2017-07-15 07:20:16 +08:00
|
|
|
if (drawSettings) {
|
2017-06-17 10:32:41 +08:00
|
|
|
drawSettings.textShape.textShapeValue = text;
|
2017-09-21 05:05:17 +08:00
|
|
|
Storage.setItem(DRAW_SETTINGS, drawSettings);
|
2017-06-17 10:32:41 +08:00
|
|
|
}
|
2017-06-11 10:21:37 +08:00
|
|
|
};
|
|
|
|
|
2017-08-24 11:35:34 +08:00
|
|
|
const resetTextShapeActiveId = () => {
|
2017-09-21 05:05:17 +08:00
|
|
|
const drawSettings = Storage.getItem(DRAW_SETTINGS);
|
2017-08-24 11:35:34 +08:00
|
|
|
if (drawSettings) {
|
|
|
|
drawSettings.textShape.textShapeActiveId = '';
|
2017-09-21 05:05:17 +08:00
|
|
|
Storage.setItem(DRAW_SETTINGS, drawSettings);
|
2017-08-24 11:35:34 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-06-17 10:32:41 +08:00
|
|
|
const activeTextShapeId = () => {
|
2017-09-21 05:05:17 +08:00
|
|
|
const drawSettings = Storage.getItem(DRAW_SETTINGS);
|
|
|
|
return drawSettings ? drawSettings.textShape.textShapeActiveId : '';
|
2017-07-15 07:20:16 +08:00
|
|
|
};
|
2017-06-17 10:32:41 +08:00
|
|
|
|
2017-06-11 10:21:37 +08:00
|
|
|
export default {
|
|
|
|
setTextShapeValue,
|
2017-06-17 10:32:41 +08:00
|
|
|
activeTextShapeId,
|
2017-08-24 11:35:34 +08:00
|
|
|
resetTextShapeActiveId,
|
2017-06-11 10:21:37 +08:00
|
|
|
};
|