[mobile] Comments (applying comment display)
This commit is contained in:
parent
dd78ba9395
commit
2a90efa7b0
|
@ -3,6 +3,7 @@ import { inject, observer } from "mobx-react";
|
||||||
import { f7 } from 'framework7-react';
|
import { f7 } from 'framework7-react';
|
||||||
import {Device} from '../../../../../common/mobile/utils/device';
|
import {Device} from '../../../../../common/mobile/utils/device';
|
||||||
import { withTranslation} from 'react-i18next';
|
import { withTranslation} from 'react-i18next';
|
||||||
|
import { LocalStorage } from '../../../utils/LocalStorage';
|
||||||
|
|
||||||
import {AddComment, EditComment, ViewComments} from '../../view/collaboration/Comments';
|
import {AddComment, EditComment, ViewComments} from '../../view/collaboration/Comments';
|
||||||
|
|
||||||
|
@ -64,6 +65,17 @@ class CommentsController extends Component {
|
||||||
Common.Notifications.on('configOptionsFill', () => {
|
Common.Notifications.on('configOptionsFill', () => {
|
||||||
this.curUserId = this.appOptions.user.id;
|
this.curUserId = this.appOptions.user.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Common.Notifications.on('document:ready', () => {
|
||||||
|
if (window.editorType === 'de' || window.editorType === 'sse') {
|
||||||
|
const api = Common.EditorApi.get();
|
||||||
|
/** coauthoring begin **/
|
||||||
|
const isLiveCommenting = LocalStorage.getBool(`${window.editorType}-mobile-settings-livecomment`, true);
|
||||||
|
const resolved = LocalStorage.getBool(`${window.editorType}-settings-resolvedcomment`, true);
|
||||||
|
isLiveCommenting ? api.asc_showComments(resolved) : api.asc_hideComments();
|
||||||
|
/** coauthoring end **/
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
addComment (id, data) {
|
addComment (id, data) {
|
||||||
const comment = this.readSDKComment(id, data);
|
const comment = this.readSDKComment(id, data);
|
||||||
|
|
|
@ -42,21 +42,21 @@ class ApplicationSettingsController extends Component {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
api.asc_hideComments();
|
api.asc_hideComments();
|
||||||
this.switchDisplayResolved(value);
|
this.switchDisplayResolved(value);
|
||||||
// Common.localStorage.setBool("de-settings-resolvedcomment", false);
|
LocalStorage.setBool("de-settings-resolvedcomment", false);
|
||||||
} else {
|
} else {
|
||||||
// let resolved = Common.localStorage.getBool("de-settings-resolvedcomment");
|
const resolved = LocalStorage.getBool("de-settings-resolvedcomment");
|
||||||
api.asc_showComments(value);
|
api.asc_showComments(resolved);
|
||||||
}
|
}
|
||||||
// Common.localStorage.setBool("de-mobile-settings-livecomment", value);
|
LocalStorage.setBool("de-mobile-settings-livecomment", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
switchDisplayResolved(value) {
|
switchDisplayResolved(value) {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
// let displayComments = Common.localStorage.getBool("de-mobile-settings-livecomment");
|
const displayComments = LocalStorage.getBool("de-mobile-settings-livecomment");
|
||||||
if (value) {
|
if (displayComments) {
|
||||||
api.asc_showComments(value);
|
api.asc_showComments(value);
|
||||||
|
LocalStorage.setBool("de-settings-resolvedcomment", value);
|
||||||
}
|
}
|
||||||
// Common.localStorage.setBool("de-settings-resolvedcomment", value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setMacrosSettings(value) {
|
setMacrosSettings(value) {
|
||||||
|
|
Loading…
Reference in a new issue