Merge pull request #1498 from ONLYOFFICE/fix/mobile-bug-54910
Fix/mobile bug 54910
This commit is contained in:
commit
8d36662f15
|
@ -213,7 +213,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
|
|
||||||
initMenuItems() {
|
initMenuItems() {
|
||||||
if ( !Common.EditorApi ) return [];
|
if ( !Common.EditorApi ) return [];
|
||||||
const { isEdit, canFillForms } = this.props;
|
const { isEdit, canFillForms, isDisconnected } = this.props;
|
||||||
|
|
||||||
if (isEdit && EditorUIController.ContextMenu) {
|
if (isEdit && EditorUIController.ContextMenu) {
|
||||||
return EditorUIController.ContextMenu.mapMenuItems(this);
|
return EditorUIController.ContextMenu.mapMenuItems(this);
|
||||||
|
@ -259,6 +259,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!isDisconnected) {
|
||||||
if ( canFillForms && canCopy && !locked ) {
|
if ( canFillForms && canCopy && !locked ) {
|
||||||
itemsIcon.push({
|
itemsIcon.push({
|
||||||
event: 'cut',
|
event: 'cut',
|
||||||
|
@ -286,6 +287,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
event: 'addcomment'
|
event: 'addcomment'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( isLink ) {
|
if ( isLink ) {
|
||||||
itemsText.push({
|
itemsText.push({
|
||||||
|
|
|
@ -407,7 +407,8 @@ class MainController extends Component {
|
||||||
onLicenseChanged (params) {
|
onLicenseChanged (params) {
|
||||||
const appOptions = this.props.storeAppOptions;
|
const appOptions = this.props.storeAppOptions;
|
||||||
const licType = params.asc_getLicenseType();
|
const licType = params.asc_getLicenseType();
|
||||||
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' &&
|
|
||||||
|
if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
|
||||||
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|
||||||
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||||
this._state.licenseType = licType;
|
this._state.licenseType = licType;
|
||||||
|
@ -557,6 +558,9 @@ class MainController extends Component {
|
||||||
storeDocumentSettings.changeDocSize(w, h);
|
storeDocumentSettings.changeDocSize(w, h);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const storeAppOptions = this.props.storeAppOptions;
|
||||||
|
|
||||||
|
if (storeAppOptions.isEdit || storeAppOptions.isRestrictedEdit && storeAppOptions.canFillForms) {
|
||||||
this.api.asc_registerCallback('asc_onShowContentControlsActions', (obj, x, y) => {
|
this.api.asc_registerCallback('asc_onShowContentControlsActions', (obj, x, y) => {
|
||||||
switch (obj.type) {
|
switch (obj.type) {
|
||||||
case Asc.c_oAscContentControlSpecificType.DateTime:
|
case Asc.c_oAscContentControlSpecificType.DateTime:
|
||||||
|
@ -579,6 +583,7 @@ class MainController extends Component {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const storeTextSettings = this.props.storeTextSettings;
|
const storeTextSettings = this.props.storeTextSettings;
|
||||||
storeTextSettings.resetFontsRecent(LocalStorage.getItem('dde-settings-recent-fonts'));
|
storeTextSettings.resetFontsRecent(LocalStorage.getItem('dde-settings-recent-fonts'));
|
||||||
|
@ -705,19 +710,20 @@ class MainController extends Component {
|
||||||
|
|
||||||
onShowDateActions(obj, x, y) {
|
onShowDateActions(obj, x, y) {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
|
const boxSdk = $$('#editor_sdk');
|
||||||
|
|
||||||
let props = obj.pr,
|
let props = obj.pr,
|
||||||
specProps = props.get_DateTimePr(),
|
specProps = props.get_DateTimePr(),
|
||||||
isPhone = Device.isPhone;
|
isPhone = Device.isPhone,
|
||||||
|
controlsContainer = boxSdk.find('#calendar-target-element'),
|
||||||
|
_dateObj = props;
|
||||||
|
|
||||||
this.controlsContainer = this.boxSdk.find('#calendar-target-element');
|
if (controlsContainer.length < 1) {
|
||||||
this._dateObj = props;
|
controlsContainer = $$('<div id="calendar-target-element" style="position: absolute;"></div>');
|
||||||
|
boxSdk.append(controlsContainer);
|
||||||
if (this.controlsContainer.length < 1) {
|
|
||||||
this.controlsContainer = $$('<div id="calendar-target-element" style="position: absolute;"></div>');
|
|
||||||
this.boxSdk.append(this.controlsContainer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.controlsContainer.css({left: `${x}px`, top: `${y}px`});
|
controlsContainer.css({left: `${x}px`, top: `${y}px`});
|
||||||
|
|
||||||
this.cmpCalendar = f7.calendar.create({
|
this.cmpCalendar = f7.calendar.create({
|
||||||
inputEl: '#calendar-target-element',
|
inputEl: '#calendar-target-element',
|
||||||
|
@ -730,7 +736,7 @@ class MainController extends Component {
|
||||||
on: {
|
on: {
|
||||||
change: (calendar, value) => {
|
change: (calendar, value) => {
|
||||||
if(calendar.initialized && value[0]) {
|
if(calendar.initialized && value[0]) {
|
||||||
let specProps = this._dateObj.get_DateTimePr();
|
let specProps = _dateObj.get_DateTimePr();
|
||||||
specProps.put_FullDate(new Date(value[0]));
|
specProps.put_FullDate(new Date(value[0]));
|
||||||
this.api.asc_SetContentControlDatePickerDate(specProps);
|
this.api.asc_SetContentControlDatePickerDate(specProps);
|
||||||
calendar.close();
|
calendar.close();
|
||||||
|
@ -747,14 +753,15 @@ class MainController extends Component {
|
||||||
|
|
||||||
onShowListActions(obj, x, y) {
|
onShowListActions(obj, x, y) {
|
||||||
if(!Device.isPhone) {
|
if(!Device.isPhone) {
|
||||||
this.dropdownListTarget = this.boxSdk.find('#dropdown-list-target');
|
const boxSdk = $$('#editor_sdk');
|
||||||
|
let dropdownListTarget = boxSdk.find('#dropdown-list-target');
|
||||||
|
|
||||||
if (this.dropdownListTarget.length < 1) {
|
if (dropdownListTarget.length < 1) {
|
||||||
this.dropdownListTarget = $$('<div id="dropdown-list-target" style="position: absolute;"></div>');
|
dropdownListTarget = $$('<div id="dropdown-list-target" style="position: absolute;"></div>');
|
||||||
this.boxSdk.append(this.dropdownListTarget);
|
boxSdk.append(dropdownListTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dropdownListTarget.css({left: `${x}px`, top: `${y}px`});
|
dropdownListTarget.css({left: `${x}px`, top: `${y}px`});
|
||||||
}
|
}
|
||||||
|
|
||||||
Common.Notifications.trigger('openDropdownList', obj);
|
Common.Notifications.trigger('openDropdownList', obj);
|
||||||
|
|
|
@ -489,7 +489,7 @@ class MainController extends Component {
|
||||||
onLicenseChanged (params) {
|
onLicenseChanged (params) {
|
||||||
const appOptions = this.props.storeAppOptions;
|
const appOptions = this.props.storeAppOptions;
|
||||||
const licType = params.asc_getLicenseType();
|
const licType = params.asc_getLicenseType();
|
||||||
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' &&
|
if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
|
||||||
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|
||||||
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||||
this._state.licenseType = licType;
|
this._state.licenseType = licType;
|
||||||
|
|
|
@ -606,7 +606,7 @@ class MainController extends Component {
|
||||||
if (appOptions.isEditDiagram || appOptions.isEditMailMerge) return;
|
if (appOptions.isEditDiagram || appOptions.isEditMailMerge) return;
|
||||||
|
|
||||||
const licType = params.asc_getLicenseType();
|
const licType = params.asc_getLicenseType();
|
||||||
if (licType !== undefined && appOptions.canEdit && appOptions.config.mode !== 'view' &&
|
if (licType !== undefined && (appOptions.canEdit || appOptions.isRestrictedEdit) && appOptions.config.mode !== 'view' &&
|
||||||
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|
(licType === Asc.c_oLicenseResult.Connections || licType === Asc.c_oLicenseResult.UsersCount || licType === Asc.c_oLicenseResult.ConnectionsOS || licType === Asc.c_oLicenseResult.UsersCountOS
|
||||||
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
|| licType === Asc.c_oLicenseResult.SuccessLimit && (appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||||
this._state.licenseType = licType;
|
this._state.licenseType = licType;
|
||||||
|
|
Loading…
Reference in a new issue