fix(click): Click Events In SlideBox Fire Multiple Times, closes #808

This commit is contained in:
Adam Bradley
2014-03-17 08:01:57 -05:00
parent d5a695757a
commit f8a7137744
2 changed files with 12 additions and 2 deletions

View File

@@ -46,7 +46,7 @@
<ion-side-menus>
<ion-pane ion-side-menu-content>
<ion-header-bar left-buttons="leftButtons" right-buttons="rightButtons" title=""></ion-header-bar>
<ion-slide-box on-slide-changed="slideChanged(index)" does-continue="true">
<ion-slide-box on-slide-changed="slideChanged(index)">
<ion-slide ng-controller="FirstSlideCtrl">
<h3>Thank you for choosing the Awesome App!</h3>
<div id="logo">
@@ -61,6 +61,9 @@
<p>
<button class="button button-dark" ng-click="toLast()">Skip to last</button>
</p>
<p>
<button class="button button-dark" ng-click="clickTest()">Click Test</button>
</p>
</ion-slide>
<ion-slide>
<h3>Using Awesome</h3>
@@ -100,6 +103,13 @@
$scope.$broadcast('slideBox.nextSlide');
};
var clickCount = 0;
$scope.clickTest = function() {
clickCount++;
console.log('click', clickCount);
};
var rightButtons = [
{
content: 'Next',

View File

@@ -165,7 +165,7 @@
gesture.originalEvent.changedTouches[0]) ||
touches[0].originalEvent || touches[0];
if(e) return { x: e.clientX, y: e.clientY };
if(e) return { x: e.clientX || e.pageX, y: e.clientY || e.pageY };
}
return { x:0, y:0 };
}