[Mobile] Bug 37604: don't show context menu by long tap

This commit is contained in:
Julia Radzhabova 2018-06-22 13:22:57 +03:00
parent 471c7f5db5
commit 7f79f37804
3 changed files with 43 additions and 1 deletions

View file

@ -577,6 +577,8 @@ define([
}
me.applyLicense();
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
},
onLicenseChanged: function(params) {
@ -1200,6 +1202,18 @@ define([
}
},
onContextMenu: function(event){
var canCopyAttr = event.target.getAttribute('data-can-copy'),
isInputEl = (event.target instanceof HTMLInputElement) || (event.target instanceof HTMLTextAreaElement);
if ((isInputEl && canCopyAttr === 'false') ||
(!isInputEl && canCopyAttr !== 'true')) {
event.stopPropagation();
event.preventDefault();
return false;
}
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
defaultTitleText: 'ONLYOFFICE Document Editor',
criticalErrorTitle: 'Error',

View file

@ -531,6 +531,8 @@ define([
}
me.applyLicense();
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
},
onLicenseChanged: function(params) {
@ -1154,6 +1156,18 @@ define([
}
},
onContextMenu: function(event){
var canCopyAttr = event.target.getAttribute('data-can-copy'),
isInputEl = (event.target instanceof HTMLInputElement) || (event.target instanceof HTMLTextAreaElement);
if ((isInputEl && canCopyAttr === 'false') ||
(!isInputEl && canCopyAttr !== 'true')) {
event.stopPropagation();
event.preventDefault();
return false;
}
},
// Translation
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
defaultTitleText: 'ONLYOFFICE Presentation Editor',

View file

@ -547,7 +547,9 @@ define([
$('.view-main').on('click', function (e) {
uiApp.closeModal('.document-menu.modal-in');
})
});
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
},
onLicenseChanged: function(params) {
@ -1320,6 +1322,18 @@ define([
if (url) this.iframePrint.src = url;
},
onContextMenu: function(event){
var canCopyAttr = event.target.getAttribute('data-can-copy'),
isInputEl = (event.target instanceof HTMLInputElement) || (event.target instanceof HTMLTextAreaElement);
if ((isInputEl && canCopyAttr === 'false') ||
(!isInputEl && canCopyAttr !== 'true')) {
event.stopPropagation();
event.preventDefault();
return false;
}
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
defaultTitleText: 'ONLYOFFICE Spreadsheet Editor',
criticalErrorTitle: 'Error',