Skip to content

Commit 719b037

Browse files
Merge pull request #124 from nteske/ScrollIssueFix
Scroll Issue Fix
2 parents 9f890d0 + d74042c commit 719b037

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

widget/index.html

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
var compressImages = false;
123123
var changeTimer;
124124
var lastImage=null;
125+
var touchmoved;
126+
125127

126128
var lazyLoad = {
127129
loadImage: function (item) {
@@ -274,8 +276,9 @@
274276
divImg.setAttribute('index', i);
275277
//divImg.onclick = plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable"? onClick : null;
276278
divImg.addEventListener('click', plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable"? onClick : null);
277-
divImg.addEventListener('touchstart',plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable"? onClick : null);
278-
279+
divImg.addEventListener('touchend',plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable"? onClick : null);
280+
divImg.addEventListener('touchmove',function(){touchmoved=true;});
281+
divImg.addEventListener('touchstart',function(){touchmoved=false;});
279282
if (p.iconUrl || p.iconClassName) {
280283
if (p.iconUrl) {
281284
divImg.classList.add("hasImg");
@@ -313,7 +316,9 @@
313316
divBlackLayer.setAttribute('index', i);
314317
//divBlackLayer.onclick = plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable" ? onClick : null;
315318
divBlackLayer.addEventListener('click',plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable" ? onClick : null);
316-
divBlackLayer.addEventListener('touchstart',plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable" ? onClick : null);
319+
divBlackLayer.addEventListener('touchend',plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable" ? onClick : null);
320+
divBlackLayer.addEventListener('touchmove',function(){touchmoved=true;});
321+
divBlackLayer.addEventListener('touchstart',function(){touchmoved=false;});
317322
pluginItemDetails.appendChild(divBlackLayer);
318323
}
319324

@@ -322,7 +327,9 @@
322327
divTitle.classList.add("media-holder-text");
323328
// divTitle.onclick = plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable" ? onClick : null;
324329
divTitle.addEventListener('click', plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable" ? onClick : null);
325-
divTitle.addEventListener('touchstart', plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable" ? onClick : null);
330+
divTitle.addEventListener('touchend', plugins[i].hasAccess|| obj.data.design.securedFeaturesOption =="Enable" ? onClick : null);
331+
divTitle.addEventListener('touchmove',function(){touchmoved=true;});
332+
divTitle.addEventListener('touchstart',function(){touchmoved=false;});
326333
divTitle.setAttribute('index', i);
327334

328335
if ([4, 5].indexOf(layout) > -1)
@@ -675,16 +682,17 @@
675682
}
676683

677684
function onClick(e) {
678-
679-
var i = parseInt(this.getAttribute('index'));
680-
var p = plugins[i];
681-
682-
buildfire.navigation.navigateTo({
683-
pluginId: p.pluginTypeId
684-
, folderName: p.folderName
685-
, instanceId: p.instanceId
686-
, title: p.title
687-
});
685+
if(touchmoved != true){
686+
var i = parseInt(this.getAttribute('index'));
687+
var p = plugins[i];
688+
689+
buildfire.navigation.navigateTo({
690+
pluginId: p.pluginTypeId
691+
, folderName: p.folderName
692+
, instanceId: p.instanceId
693+
, title: p.title
694+
});
695+
}
688696
}
689697

690698
function shuffle(a,first,last) {

0 commit comments

Comments
 (0)