Skip to content

Commit

Permalink
Merge pull request #165 from cytsunny/master
Browse files Browse the repository at this point in the history
Making 3 examples work again. The cancel function is still not working?
  • Loading branch information
fatlinesofcode committed Jun 19, 2015
2 parents 840dd1c + fa00c77 commit 31bb08b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions example-cancel.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>ngDraggable</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
<style>

*{
Expand Down Expand Up @@ -120,7 +120,7 @@ <h2>Cancel drag from child element.</h2>
</div>
<footer style="margin-top:2000px;">footer</footer>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="ngDraggable.js"></script>
<script>
angular.module('ExampleApp', ['ngDraggable']).
Expand Down Expand Up @@ -160,4 +160,4 @@ <h2>Cancel drag from child element.</h2>
});
</script>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions example-clone.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>ngDraggable</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
<style>

*{
Expand Down Expand Up @@ -110,7 +110,7 @@ <h1>ngDraggable Clone Example</h1>

<footer style="margin-top:2000px;">footer</footer>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="ngDraggable.js"></script>
<script>
angular.module('ExampleApp', ['ngDraggable']).
Expand Down
6 changes: 3 additions & 3 deletions example-reorder.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>ngDraggable</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
<style>

* {
Expand Down Expand Up @@ -109,7 +109,7 @@ <h1>ngDraggable Ordering Example</h1>

<hr/>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="ngDraggable.js"></script>
<script>
angular.module('ExampleApp', ['ngDraggable']).
Expand All @@ -128,4 +128,4 @@ <h1>ngDraggable Ordering Example</h1>
});
</script>
</body>
</html>
</html>
6 changes: 3 additions & 3 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>ngDraggable</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
<style>

*{
Expand Down Expand Up @@ -113,7 +113,7 @@ <h1>ngDraggable Example</h1>
</div>
<footer style="margin-top:2000px;">footer</footer>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script src="ngDraggable.js"></script>
<script>
angular.module('ExampleApp', ['ngDraggable']).
Expand Down Expand Up @@ -153,4 +153,4 @@ <h1>ngDraggable Example</h1>
});
</script>
</body>
</html>
</html>
3 changes: 2 additions & 1 deletion ngDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ angular.module("ngDraggable", [])
if (angular.isDefined(event.touches)) {
return event.touches[0];
}
else if (angular.isDefined(event.originalEvent.touches)) {
//Checking both is not redundent. If only check if touches isDefined, angularjs isDefnied will return error and stop the remaining scripty if event.originalEvent is not defined.
else if (angular.isDefined(event.originalEvent) && angular.isDefined(event.originalEvent.touches)) {
return event.originalEvent.touches[0];
}
return event;
Expand Down

0 comments on commit 31bb08b

Please sign in to comment.