Skip to content

Commit

Permalink
fix touch functionality in Edge
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkettner committed Aug 14, 2015
1 parent c92dd72 commit ff09e07
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function(grunt) {
header: '+function ($) {\n' +
' "use strict";\n' +
'\n' +
' if (!("ontouchstart" in window || navigator.msMaxTouchPoints)) return false \n\n',
' if (!("ontouchstart" in window || "PointerEvent" in window || navigator.msMaxTouchPoints)) return false \n\n',
footer: '}(window.jQuery);'
},

Expand Down
2 changes: 1 addition & 1 deletion dist/js/bootstrap-touch-carousel.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/tests/unit/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(function () {
// console.log( "ontouchstart" in window ? true: false); // return true in PhantomJS

test("Should run plugin because touchevents are enabled", function() {
var hasTouchEvents = ("ontouchstart" in window || navigator.msMaxTouchPoints) ? true : false;
var hasTouchEvents = ("ontouchstart" in window || "PointerEvent" in window || navigator.msMaxTouchPoints) ? true : false;
equal(hasTouchEvents, true, "touch events should be enabled")
ok(typeof $(document.body).carousel().data('touch-carousel') === "object", "TouchCarousel Plugin is running")
})
Expand Down
2 changes: 1 addition & 1 deletion src/js/touch-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Return whole plugin if touch is not supported
*/
if (!("ontouchstart" in window || navigator.msMaxTouchPoints)) return false;
if (!("ontouchstart" in window || "PointerEvent" in window || "navigator.msMaxTouchPoints)) return false;

// CONST
var NAMESPACE = 'touch-carousel';
Expand Down
2 changes: 1 addition & 1 deletion src/js/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Return whole plugin if touch is not supported
*/
if (!("ontouchstart" in window || navigator.msMaxTouchPoints)) {
if (!("ontouchstart" in window || "PointerEvent" in window || navigator.msMaxTouchPoints)) {
return false;
}

Expand Down

0 comments on commit ff09e07

Please sign in to comment.