Skip to content

Commit 871f287

Browse files
committed
Updating ripple service to use originalEvent only if it is present
1 parent 7023cc2 commit 871f287

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

‎.editorconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
root = true
22
[*]
3+
end_of_line = lf
34
insert_final_newline = true
45
[*.js]
56
indent_style = space

‎dist/angular-bootstrap-material.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ angular.module('angularBootstrapMaterial').factory('ripple', function () {
347347
* Make sure the user is using only one finger and then get the touch
348348
* position relative to the ripple wrapper
349349
*/
350-
event = event.originalEvent;
351-
350+
if (event.originalEvent) // Do this only ifjQuery is present for some reason
351+
event = event.originalEvent
352352
if (event.touches.length === 1) {
353353
return event.touches[0].pageX - wrapperOffset.left;
354354
}
@@ -374,7 +374,8 @@ angular.module('angularBootstrapMaterial').factory('ripple', function () {
374374
* Make sure the user is using only one finger and then get the touch
375375
* position relative to the ripple wrapper
376376
*/
377-
event = event.originalEvent;
377+
if (event.originalEvent) // Do this only ifjQuery is present for some reason
378+
event = event.originalEvent
378379

379380
if (event.touches.length === 1) {
380381
return event.touches[0].pageY - wrapperOffset.top;
@@ -588,4 +589,4 @@ $templateCache.put("templates/form-group.html","<div class=\"form-group\" ng-cla
588589
$templateCache.put("templates/input.html","<input id=\"input_{{$id}}\" name=\"input_{{$id}}\" class=\"form-control\">\n");
589590
$templateCache.put("templates/label.html","<label for=\"{{\'input_\'+ formControl.$id}}\" class=\"control-label\">{{label}}</label>\n");
590591
$templateCache.put("templates/radio.html","<label>\n <abm-transclude-slot-radio></abm-transclude-slot-radio>\n <span class=\"circle\"></span><span class=\"check\"></span> {{label}}\n</label>\n");
591-
$templateCache.put("templates/toggle.html","<label>\n {{label}}\n <abm-transclude-slot-toggle></abm-transclude-slot-toggle>\n <span class=\"toggle\"></span>\n</label>\n");}]);
592+
$templateCache.put("templates/toggle.html","<label>\n {{label}}\n <abm-transclude-slot-toggle></abm-transclude-slot-toggle>\n <span class=\"toggle\"></span>\n</label>\n");}]);

‎dist/angular-bootstrap-material.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/scripts/services/ripple.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ angular.module('angularBootstrapMaterial').factory('ripple', function () {
5252
* Make sure the user is using only one finger and then get the touch
5353
* position relative to the ripple wrapper
5454
*/
55-
event = event.originalEvent;
56-
55+
if (event.originalEvent) // Do this only if jQuery is present for some reason
56+
event = event.originalEvent
5757
if (event.touches.length === 1) {
5858
return event.touches[0].pageX - wrapperOffset.left;
5959
}
@@ -79,7 +79,8 @@ angular.module('angularBootstrapMaterial').factory('ripple', function () {
7979
* Make sure the user is using only one finger and then get the touch
8080
* position relative to the ripple wrapper
8181
*/
82-
event = event.originalEvent;
82+
if (event.originalEvent) // Do this only if jQuery is present for some reason
83+
event = event.originalEvent
8384

8485
if (event.touches.length === 1) {
8586
return event.touches[0].pageY - wrapperOffset.top;

0 commit comments

Comments
 (0)