Fix Bug 40281

This commit is contained in:
Julia Radzhabova 2019-04-04 15:15:11 +03:00
parent 171e0078a6
commit 1dc8508ac3
3 changed files with 9 additions and 3 deletions

View file

@ -101,6 +101,9 @@ define([
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
Common.NotificationCenter.on('readermode:change', function (reader) {
_startPoint = {};
});
},
showSearch: function () {
@ -121,7 +124,8 @@ define([
var _endPoint = pointerEventToXY(e);
if (_isShow) {
var distance = Math.sqrt((_endPoint.x -= _startPoint.x) * _endPoint.x + (_endPoint.y -= _startPoint.y) * _endPoint.y);
var distance = (_startPoint.x===undefined || _startPoint.y===undefined) ? 0 :
Math.sqrt((_endPoint.x -= _startPoint.x) * _endPoint.x + (_endPoint.y -= _startPoint.y) * _endPoint.y);
if (distance < 1) {
this.hideSearch();

View file

@ -121,7 +121,8 @@ define([
var _endPoint = pointerEventToXY(e);
if (_isShow) {
var distance = Math.sqrt((_endPoint.x -= _startPoint.x) * _endPoint.x + (_endPoint.y -= _startPoint.y) * _endPoint.y);
var distance = (_startPoint.x===undefined || _startPoint.y===undefined) ? 0 :
Math.sqrt((_endPoint.x -= _startPoint.x) * _endPoint.x + (_endPoint.y -= _startPoint.y) * _endPoint.y);
if (distance < 1) {
this.hideSearch();

View file

@ -120,7 +120,8 @@ define([
var _endPoint = pointerEventToXY(e);
if (_isShow) {
var distance = Math.sqrt((_endPoint.x -= _startPoint.x) * _endPoint.x + (_endPoint.y -= _startPoint.y) * _endPoint.y);
var distance = (_startPoint.x===undefined || _startPoint.y===undefined) ? 0 :
Math.sqrt((_endPoint.x -= _startPoint.x) * _endPoint.x + (_endPoint.y -= _startPoint.y) * _endPoint.y);
if (distance < 1) {
this.hideSearch();