[PE SSE mobile] Fix Bug 51540
This commit is contained in:
parent
3e508e7de3
commit
1cf8b0c9c7
|
@ -156,6 +156,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
showCopyCutPasteModal() {
|
showCopyCutPasteModal() {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
const _t = t("ContextMenu", { returnObjects: true });
|
const _t = t("ContextMenu", { returnObjects: true });
|
||||||
|
|
||||||
f7.dialog.create({
|
f7.dialog.create({
|
||||||
title: _t.textCopyCutPasteActions,
|
title: _t.textCopyCutPasteActions,
|
||||||
text: _t.errorCopyCutPaste,
|
text: _t.errorCopyCutPaste,
|
||||||
|
@ -180,6 +181,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
const _t = t("ContextMenu", { returnObjects: true });
|
const _t = t("ContextMenu", { returnObjects: true });
|
||||||
let picker;
|
let picker;
|
||||||
|
|
||||||
const dialog = f7.dialog.create({
|
const dialog = f7.dialog.create({
|
||||||
title: _t.menuSplit,
|
title: _t.menuSplit,
|
||||||
text: '',
|
text: '',
|
||||||
|
@ -250,6 +252,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
|
|
||||||
initMenuItems() {
|
initMenuItems() {
|
||||||
if ( !Common.EditorApi ) return [];
|
if ( !Common.EditorApi ) return [];
|
||||||
|
|
||||||
const { isEdit, canFillForms, isDisconnected } = this.props;
|
const { isEdit, canFillForms, isDisconnected } = this.props;
|
||||||
|
|
||||||
if (isEdit && EditorUIController.ContextMenu) {
|
if (isEdit && EditorUIController.ContextMenu) {
|
||||||
|
|
|
@ -15,7 +15,8 @@ import EditorUIController from '../lib/patch';
|
||||||
canViewComments: stores.storeAppOptions.canViewComments,
|
canViewComments: stores.storeAppOptions.canViewComments,
|
||||||
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
|
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
|
||||||
users: stores.users,
|
users: stores.users,
|
||||||
isDisconnected: stores.users.isDisconnected
|
isDisconnected: stores.users.isDisconnected,
|
||||||
|
objects: stores.storeFocusObjects.settings
|
||||||
}))
|
}))
|
||||||
class ContextMenu extends ContextMenuController {
|
class ContextMenu extends ContextMenuController {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -26,6 +27,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
this.onApiHideComment = this.onApiHideComment.bind(this);
|
this.onApiHideComment = this.onApiHideComment.bind(this);
|
||||||
this.getUserName = this.getUserName.bind(this);
|
this.getUserName = this.getUserName.bind(this);
|
||||||
this.isUserVisible = this.isUserVisible.bind(this);
|
this.isUserVisible = this.isUserVisible.bind(this);
|
||||||
|
this.checkShapeSelection = this.checkShapeSelection.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
static closeContextMenu() {
|
static closeContextMenu() {
|
||||||
|
@ -49,6 +51,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
if ( api ) {
|
if ( api ) {
|
||||||
api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment);
|
api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment);
|
||||||
api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment);
|
api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment);
|
||||||
|
api.asc_unregisterCallback('asc_onShowPopMenu', this.checkShapeSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +107,15 @@ class ContextMenu extends ContextMenuController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkShapeSelection() {
|
||||||
|
const objects = this.props.objects;
|
||||||
|
const contextMenuElem = document.querySelector('#idx-context-menu-popover');
|
||||||
|
|
||||||
|
if(objects.indexOf('shape') > -1) {
|
||||||
|
contextMenuElem.style.top = `${+(contextMenuElem.style.top.replace(/px$/, '')) - 40}px`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
showCopyCutPasteModal() {
|
showCopyCutPasteModal() {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
const _t = t("ContextMenu", { returnObjects: true });
|
const _t = t("ContextMenu", { returnObjects: true });
|
||||||
|
@ -197,6 +209,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
api.asc_registerCallback('asc_onShowComment', this.onApiShowComment);
|
api.asc_registerCallback('asc_onShowComment', this.onApiShowComment);
|
||||||
api.asc_registerCallback('asc_onHideComment', this.onApiHideComment);
|
api.asc_registerCallback('asc_onHideComment', this.onApiHideComment);
|
||||||
|
api.asc_registerCallback('asc_onShowPopMenu', this.checkShapeSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
initMenuItems() {
|
initMenuItems() {
|
||||||
|
|
|
@ -19,7 +19,9 @@ import EditorUIController from '../lib/patch';
|
||||||
isDisconnected: stores.users.isDisconnected,
|
isDisconnected: stores.users.isDisconnected,
|
||||||
storeSheets: stores.sheets,
|
storeSheets: stores.sheets,
|
||||||
wsProps: stores.storeWorksheets.wsProps,
|
wsProps: stores.storeWorksheets.wsProps,
|
||||||
wsLock: stores.storeWorksheets.wsLock
|
wsLock: stores.storeWorksheets.wsLock,
|
||||||
|
objects: stores.storeFocusObjects.objects,
|
||||||
|
focusOn: stores.storeFocusObjects.focusOn
|
||||||
}))
|
}))
|
||||||
class ContextMenu extends ContextMenuController {
|
class ContextMenu extends ContextMenuController {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -34,6 +36,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
this.isUserVisible = this.isUserVisible.bind(this);
|
this.isUserVisible = this.isUserVisible.bind(this);
|
||||||
this.onApiMouseMove = this.onApiMouseMove.bind(this);
|
this.onApiMouseMove = this.onApiMouseMove.bind(this);
|
||||||
this.onApiHyperlinkClick = this.onApiHyperlinkClick.bind(this);
|
this.onApiHyperlinkClick = this.onApiHyperlinkClick.bind(this);
|
||||||
|
this.checkShapeSelection = this.checkShapeSelection.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
static closeContextMenu() {
|
static closeContextMenu() {
|
||||||
|
@ -59,6 +62,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment);
|
api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment);
|
||||||
api.asc_unregisterCallback('asc_onMouseMove', this.onApiMouseMove);
|
api.asc_unregisterCallback('asc_onMouseMove', this.onApiMouseMove);
|
||||||
api.asc_unregisterCallback('asc_onHyperlinkClick', this.onApiHyperlinkClick);
|
api.asc_unregisterCallback('asc_onHyperlinkClick', this.onApiHyperlinkClick);
|
||||||
|
api.asc_unregisterCallback('asc_onShowPopMenu', this.checkShapeSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,6 +212,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
api.asc_registerCallback('asc_onHideComment', this.onApiHideComment);
|
api.asc_registerCallback('asc_onHideComment', this.onApiHideComment);
|
||||||
api.asc_registerCallback('asc_onMouseMove', this.onApiMouseMove);
|
api.asc_registerCallback('asc_onMouseMove', this.onApiMouseMove);
|
||||||
api.asc_registerCallback('asc_onHyperlinkClick', this.onApiHyperlinkClick);
|
api.asc_registerCallback('asc_onHyperlinkClick', this.onApiHyperlinkClick);
|
||||||
|
api.asc_registerCallback('asc_onShowPopMenu', this.checkShapeSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
initMenuItems() {
|
initMenuItems() {
|
||||||
|
@ -280,6 +285,16 @@ class ContextMenu extends ContextMenuController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkShapeSelection() {
|
||||||
|
const objects = this.props.objects;
|
||||||
|
const focusOn = this.props.focusOn;
|
||||||
|
const contextMenuElem = document.querySelector('#idx-context-menu-popover');
|
||||||
|
|
||||||
|
if(objects.indexOf('shape') > -1 && focusOn === 'obj') {
|
||||||
|
contextMenuElem.style.top = `${+(contextMenuElem.style.top.replace(/px$/, '')) - 40}px`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onApiMouseMove(dataarray) {
|
onApiMouseMove(dataarray) {
|
||||||
const tipHeight = 20;
|
const tipHeight = 20;
|
||||||
let index_locked,
|
let index_locked,
|
||||||
|
|
|
@ -44,19 +44,19 @@ export class storeFocusObjects {
|
||||||
for (let object of this._focusObjects) {
|
for (let object of this._focusObjects) {
|
||||||
const type = object.get_ObjectType();
|
const type = object.get_ObjectType();
|
||||||
|
|
||||||
if (Asc.c_oAscTypeSelectElement.Paragraph == type) {
|
if (Asc.c_oAscTypeSelectElement.Paragraph === type) {
|
||||||
_objects.push('text', 'paragraph');
|
_objects.push('text', 'paragraph');
|
||||||
} else if (Asc.c_oAscTypeSelectElement.Table == type) {
|
} else if (Asc.c_oAscTypeSelectElement.Table === type) {
|
||||||
_objects.push('table');
|
_objects.push('table');
|
||||||
} else if (Asc.c_oAscTypeSelectElement.Image == type) {
|
} else if (Asc.c_oAscTypeSelectElement.Image === type) {
|
||||||
if (object.get_ObjectValue().get_ChartProperties()) {
|
if (object.get_ObjectValue().get_ChartProperties()) {
|
||||||
_objects.push('chart');
|
_objects.push('chart');
|
||||||
} else if (object.get_ObjectValue().get_ShapeProperties()) {
|
} else if (object.get_ObjectValue().get_ShapeProperties() && !_objects.includes('chart')) {
|
||||||
_objects.push('shape');
|
_objects.push('shape');
|
||||||
} else {
|
} else {
|
||||||
_objects.push('image');
|
_objects.push('image');
|
||||||
}
|
}
|
||||||
} else if (Asc.c_oAscTypeSelectElement.Hyperlink == type) {
|
} else if (Asc.c_oAscTypeSelectElement.Hyperlink === type) {
|
||||||
_objects.push('hyperlink');
|
_objects.push('hyperlink');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue