From: qunfang.lin Date: Tue, 20 Oct 2020 10:19:56 +0000 (+0800) Subject: [mobile][Touch][TSIX-6804, fix drag red button issue] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e3df5f5d14f76a49824fa0ece36353b61f3a7fb;p=test%2Ftct%2Fweb%2Fbehavior.git [mobile][Touch][TSIX-6804, fix drag red button issue] -Can't drag the red button by two fingers normally Change-Id: I834ac5aa20d59050c8df67e05042953ae11147d9 Signed-off-by: qunfang.lin --- diff --git a/mobile/tct-behavior-tests/tests/Touch/js/main.js b/mobile/tct-behavior-tests/tests/Touch/js/main.js index 897c676..4832707 100755 --- a/mobile/tct-behavior-tests/tests/Touch/js/main.js +++ b/mobile/tct-behavior-tests/tests/Touch/js/main.js @@ -86,19 +86,26 @@ jQuery(document).ready(function() { var image = $("#imageScroll")[0]; image.src = "img/btn_down.png"; var changedTouches = event.changedTouches; - if(changedTouches.item(0).clientX <= getLeft($("#scrollEare")[0])+40){ + var cursor = 0; + if (changedTouches.length == 2) + { + if (changedTouches.item(0).clientY < changedTouches.item(1).clientY) + cursor = 1; + } + + if(changedTouches.item(cursor).clientX <= getLeft($("#scrollEare")[0])+40){ scrollTarget.style.left = getLeft($("#scrollEare")[0])+"px"; - }else if(changedTouches.item(0).clientX >= getLeft($("#scrollEare")[0])+250){ + }else if(changedTouches.item(cursor).clientX >= getLeft($("#scrollEare")[0])+250){ scrollTarget.style.left = getLeft($("#scrollEare")[0])+250 +"px"; }else{ - scrollTarget.style.left = changedTouches.item(0).clientX-40 +"px"; + scrollTarget.style.left = changedTouches.item(cursor).clientX-40 +"px"; } - if(changedTouches.item(0).clientY <= getTop($("#scrollEare")[0])+40){ + if(changedTouches.item(cursor).clientY <= getTop($("#scrollEare")[0])+40){ scrollTarget.style.top =getTop($("#scrollEare")[0]) +"px"; - } else if(changedTouches.item(0).clientY >= getTop($("#scrollEare")[0])+150){ + } else if(changedTouches.item(cursor).clientY >= getTop($("#scrollEare")[0])+150){ scrollTarget.style.top =getTop($("#scrollEare")[0])+150 +"px"; } else{ - scrollTarget.style.top = changedTouches.item(0).clientY-40 +"px"; + scrollTarget.style.top = changedTouches.item(cursor).clientY-40 +"px"; } }, false);