Merge pull request #421 from ONLYOFFICE/feature/bug-45844

[Mobile] For Bug 45844
This commit is contained in:
Alexander Trofimov 2020-07-16 15:09:07 +03:00 committed by GitHub
commit d8b106d6e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 6 deletions

View file

@ -69,6 +69,12 @@ define([
return out;
};
function iOSVersion() {
var ua = navigator.userAgent;
var m;
return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0;
}
return {
models: [],
collections: [],
@ -99,8 +105,14 @@ define([
var me = this;
me.createView('Search').render();
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
if (iOSVersion()<13) {
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
} else {
$('#editor_sdk').single('pointerdown', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('pointerup', _.bind(me.onEditorTouchEnd, me));
}
Common.NotificationCenter.on('readermode:change', function (reader) {
_startPoint = {};
});

View file

@ -69,6 +69,12 @@ define([
return out;
};
function iOSVersion() {
var ua = navigator.userAgent;
var m;
return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0;
}
return {
models: [],
collections: [],
@ -99,8 +105,13 @@ define([
var me = this;
me.createView('Search').render();
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
if (iOSVersion()<13) {
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
} else {
$('#editor_sdk').single('pointerdown', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('pointerup', _.bind(me.onEditorTouchEnd, me));
}
},
showSearch: function () {

View file

@ -68,6 +68,12 @@ define([
return out;
};
function iOSVersion() {
var ua = navigator.userAgent;
var m;
return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0;
}
return {
models: [],
collections: [],
@ -100,8 +106,13 @@ define([
var me = this;
me.createView('Search').render();
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
if (iOSVersion()<13) {
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
} else {
$('#editor_sdk').single('pointerdown', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('pointerup', _.bind(me.onEditorTouchEnd, me));
}
},
showSearch: function () {