Skip to content

Commit 31bb08b

Browse files
Merge pull request #165 from cytsunny/master
Making 3 examples work again. The cancel function is still not working?
2 parents 840dd1c + fa00c77 commit 31bb08b

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

example-cancel.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>ngDraggable</title>
5-
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
5+
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
66
<style>
77

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

123-
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
123+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
124124
<script src="ngDraggable.js"></script>
125125
<script>
126126
angular.module('ExampleApp', ['ngDraggable']).
@@ -160,4 +160,4 @@ <h2>Cancel drag from child element.</h2>
160160
});
161161
</script>
162162
</body>
163-
</html>
163+
</html>

example-clone.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>ngDraggable</title>
5-
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
5+
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
66
<style>
77

88
*{
@@ -110,7 +110,7 @@ <h1>ngDraggable Clone Example</h1>
110110

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

113-
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
113+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
114114
<script src="ngDraggable.js"></script>
115115
<script>
116116
angular.module('ExampleApp', ['ngDraggable']).

example-reorder.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>ngDraggable</title>
5-
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
5+
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
66
<style>
77

88
* {
@@ -109,7 +109,7 @@ <h1>ngDraggable Ordering Example</h1>
109109

110110
<hr/>
111111

112-
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
112+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
113113
<script src="ngDraggable.js"></script>
114114
<script>
115115
angular.module('ExampleApp', ['ngDraggable']).
@@ -128,4 +128,4 @@ <h1>ngDraggable Ordering Example</h1>
128128
});
129129
</script>
130130
</body>
131-
</html>
131+
</html>

example.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>ngDraggable</title>
5-
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
5+
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootswatch/2.3.1/spruce/bootstrap.min.css">
66
<style>
77

88
*{
@@ -113,7 +113,7 @@ <h1>ngDraggable Example</h1>
113113
</div>
114114
<footer style="margin-top:2000px;">footer</footer>
115115

116-
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
116+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
117117
<script src="ngDraggable.js"></script>
118118
<script>
119119
angular.module('ExampleApp', ['ngDraggable']).
@@ -153,4 +153,4 @@ <h1>ngDraggable Example</h1>
153153
});
154154
</script>
155155
</body>
156-
</html>
156+
</html>

ngDraggable.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ angular.module("ngDraggable", [])
1111
if (angular.isDefined(event.touches)) {
1212
return event.touches[0];
1313
}
14-
else if (angular.isDefined(event.originalEvent.touches)) {
14+
//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.
15+
else if (angular.isDefined(event.originalEvent) && angular.isDefined(event.originalEvent.touches)) {
1516
return event.originalEvent.touches[0];
1617
}
1718
return event;

0 commit comments

Comments
 (0)