fomantic-ui 2.9.0-beta.278 → 2.9.0-beta.280

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/.all-contributorsrc +9 -0
  2. package/.github/workflows/ci.yml +1 -0
  3. package/CONTRIBUTORS.md +1 -0
  4. package/dist/components/accordion.css +1 -1
  5. package/dist/components/accordion.js +1 -1
  6. package/dist/components/accordion.min.css +1 -1
  7. package/dist/components/accordion.min.js +1 -1
  8. package/dist/components/ad.css +1 -1
  9. package/dist/components/ad.min.css +1 -1
  10. package/dist/components/api.js +1 -1
  11. package/dist/components/api.min.js +1 -1
  12. package/dist/components/breadcrumb.css +1 -1
  13. package/dist/components/breadcrumb.min.css +1 -1
  14. package/dist/components/button.css +1 -1
  15. package/dist/components/button.min.css +1 -1
  16. package/dist/components/calendar.css +1 -1
  17. package/dist/components/calendar.js +1 -1
  18. package/dist/components/calendar.min.css +1 -1
  19. package/dist/components/calendar.min.js +1 -1
  20. package/dist/components/card.css +1 -1
  21. package/dist/components/card.min.css +1 -1
  22. package/dist/components/checkbox.css +1 -1
  23. package/dist/components/checkbox.js +1 -1
  24. package/dist/components/checkbox.min.css +1 -1
  25. package/dist/components/checkbox.min.js +1 -1
  26. package/dist/components/comment.css +1 -1
  27. package/dist/components/comment.min.css +1 -1
  28. package/dist/components/container.css +1 -1
  29. package/dist/components/container.min.css +1 -1
  30. package/dist/components/dimmer.css +1 -1
  31. package/dist/components/dimmer.js +1 -1
  32. package/dist/components/dimmer.min.css +1 -1
  33. package/dist/components/dimmer.min.js +1 -1
  34. package/dist/components/divider.css +1 -1
  35. package/dist/components/divider.min.css +1 -1
  36. package/dist/components/dropdown.css +1 -1
  37. package/dist/components/dropdown.js +1 -1
  38. package/dist/components/dropdown.min.css +1 -1
  39. package/dist/components/dropdown.min.js +1 -1
  40. package/dist/components/embed.css +1 -1
  41. package/dist/components/embed.js +1 -1
  42. package/dist/components/embed.min.css +1 -1
  43. package/dist/components/embed.min.js +1 -1
  44. package/dist/components/feed.css +1 -1
  45. package/dist/components/feed.min.css +1 -1
  46. package/dist/components/flag.css +1 -1
  47. package/dist/components/flag.min.css +1 -1
  48. package/dist/components/form.css +1 -1
  49. package/dist/components/form.js +1 -1
  50. package/dist/components/form.min.css +1 -1
  51. package/dist/components/form.min.js +1 -1
  52. package/dist/components/grid.css +1 -1
  53. package/dist/components/grid.min.css +1 -1
  54. package/dist/components/header.css +1 -1
  55. package/dist/components/header.min.css +1 -1
  56. package/dist/components/icon.css +1 -1
  57. package/dist/components/icon.min.css +1 -1
  58. package/dist/components/image.css +1 -1
  59. package/dist/components/image.min.css +1 -1
  60. package/dist/components/input.css +1 -1
  61. package/dist/components/input.min.css +1 -1
  62. package/dist/components/item.css +1 -1
  63. package/dist/components/item.min.css +1 -1
  64. package/dist/components/label.css +1 -1
  65. package/dist/components/label.min.css +1 -1
  66. package/dist/components/list.css +1 -1
  67. package/dist/components/list.min.css +1 -1
  68. package/dist/components/loader.css +1 -1
  69. package/dist/components/loader.min.css +1 -1
  70. package/dist/components/message.css +1 -1
  71. package/dist/components/message.min.css +1 -1
  72. package/dist/components/modal.css +1 -1
  73. package/dist/components/modal.js +1 -1
  74. package/dist/components/modal.min.css +1 -1
  75. package/dist/components/modal.min.js +1 -1
  76. package/dist/components/nag.css +1 -1
  77. package/dist/components/nag.js +1 -1
  78. package/dist/components/nag.min.css +1 -1
  79. package/dist/components/nag.min.js +1 -1
  80. package/dist/components/placeholder.css +1 -1
  81. package/dist/components/placeholder.min.css +1 -1
  82. package/dist/components/popup.css +1 -1
  83. package/dist/components/popup.js +1 -1
  84. package/dist/components/popup.min.css +1 -1
  85. package/dist/components/popup.min.js +1 -1
  86. package/dist/components/progress.css +1 -1
  87. package/dist/components/progress.js +1 -1
  88. package/dist/components/progress.min.css +1 -1
  89. package/dist/components/progress.min.js +1 -1
  90. package/dist/components/rail.css +1 -1
  91. package/dist/components/rail.min.css +1 -1
  92. package/dist/components/rating.css +1 -1
  93. package/dist/components/rating.js +1 -1
  94. package/dist/components/rating.min.css +1 -1
  95. package/dist/components/rating.min.js +1 -1
  96. package/dist/components/reset.css +1 -1
  97. package/dist/components/reset.min.css +1 -1
  98. package/dist/components/reveal.css +1 -1
  99. package/dist/components/reveal.min.css +1 -1
  100. package/dist/components/search.css +1 -1
  101. package/dist/components/search.js +1 -1
  102. package/dist/components/search.min.css +1 -1
  103. package/dist/components/search.min.js +1 -1
  104. package/dist/components/segment.css +1 -1
  105. package/dist/components/segment.min.css +1 -1
  106. package/dist/components/shape.css +1 -1
  107. package/dist/components/shape.js +1 -1
  108. package/dist/components/shape.min.css +1 -1
  109. package/dist/components/shape.min.js +1 -1
  110. package/dist/components/sidebar.css +1 -1
  111. package/dist/components/sidebar.js +1 -1
  112. package/dist/components/sidebar.min.css +1 -1
  113. package/dist/components/sidebar.min.js +1 -1
  114. package/dist/components/site.css +1 -1
  115. package/dist/components/site.js +1 -1
  116. package/dist/components/site.min.css +1 -1
  117. package/dist/components/site.min.js +1 -1
  118. package/dist/components/slider.js +68 -51
  119. package/dist/components/slider.min.js +2 -2
  120. package/dist/components/state.js +1 -1
  121. package/dist/components/state.min.js +1 -1
  122. package/dist/components/statistic.css +1 -1
  123. package/dist/components/statistic.min.css +1 -1
  124. package/dist/components/step.css +1 -1
  125. package/dist/components/step.min.css +1 -1
  126. package/dist/components/sticky.css +1 -1
  127. package/dist/components/sticky.js +1 -1
  128. package/dist/components/sticky.min.css +1 -1
  129. package/dist/components/sticky.min.js +1 -1
  130. package/dist/components/tab.css +1 -1
  131. package/dist/components/tab.js +1 -1
  132. package/dist/components/tab.min.css +1 -1
  133. package/dist/components/tab.min.js +1 -1
  134. package/dist/components/table.css +1 -1
  135. package/dist/components/table.min.css +1 -1
  136. package/dist/components/text.css +1 -1
  137. package/dist/components/text.min.css +1 -1
  138. package/dist/components/toast.css +1 -1
  139. package/dist/components/toast.js +1 -1
  140. package/dist/components/toast.min.css +1 -1
  141. package/dist/components/toast.min.js +1 -1
  142. package/dist/components/transition.css +1 -1
  143. package/dist/components/transition.js +1 -1
  144. package/dist/components/transition.min.css +1 -1
  145. package/dist/components/transition.min.js +1 -1
  146. package/dist/components/visibility.js +1 -1
  147. package/dist/components/visibility.min.js +1 -1
  148. package/dist/semantic.css +49 -49
  149. package/dist/semantic.js +92 -75
  150. package/dist/semantic.min.css +1 -1
  151. package/dist/semantic.min.js +2 -2
  152. package/package.json +1 -1
  153. package/src/definitions/modules/slider.js +67 -50
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Nag
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Nag
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Nag
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Nag
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Nag
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Nag
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.278+4d5303c
2
+ * # Fomantic UI - 2.9.0-beta.280+ed3a2aa
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Loader
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Loader
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Loader
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Loader
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Popup
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Popup
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Popup
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Popup
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Popup
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Popup
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.278+4d5303c
2
+ * # Fomantic UI - 2.9.0-beta.280+ed3a2aa
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Progress Bar
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Progress Bar
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Progress
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Progress
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Progress Bar
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Progress Bar
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.278+4d5303c
2
+ * # Fomantic UI - 2.9.0-beta.280+ed3a2aa
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Rail
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Rail
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Rail
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Rail
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Rating
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Rating
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Rating
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Rating
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Rating
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Rating
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.278+4d5303c
2
+ * # Fomantic UI - 2.9.0-beta.280+ed3a2aa
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Reset
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Reset
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Reset
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Reset
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Reveal
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Reveal
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Reveal
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Reveal
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Search
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Search
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Search
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Search
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Search
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Search
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.278+4d5303c
2
+ * # Fomantic UI - 2.9.0-beta.280+ed3a2aa
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Segment
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Segment
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Segment
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Segment
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Shape
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Shape
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Shape
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Shape
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Shape
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Shape
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.278+4d5303c
2
+ * # Fomantic UI - 2.9.0-beta.280+ed3a2aa
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Sidebar
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Sidebar
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Sidebar
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Sidebar
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Sidebar
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Sidebar
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.278+4d5303c
2
+ * # Fomantic UI - 2.9.0-beta.280+ed3a2aa
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Site
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Site
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Site
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Site
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Site
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Site
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.278+4d5303c
2
+ * # Fomantic UI - 2.9.0-beta.280+ed3a2aa
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.9.0-beta.278+4d5303c - Slider
2
+ * # Fomantic-UI 2.9.0-beta.280+ed3a2aa - Slider
3
3
  * http://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -70,6 +70,7 @@ $.fn.slider = function(parameters) {
70
70
 
71
71
  $module = $(this),
72
72
  $currThumb,
73
+ touchIdentifier,
73
74
  $thumb,
74
75
  $secondThumb,
75
76
  $track,
@@ -86,7 +87,6 @@ $.fn.slider = function(parameters) {
86
87
  secondPos,
87
88
  offset,
88
89
  precision,
89
- isTouch,
90
90
  gapRatio = 1,
91
91
  previousValue,
92
92
 
@@ -104,7 +104,6 @@ $.fn.slider = function(parameters) {
104
104
  currentRange += 1;
105
105
  documentEventID = currentRange;
106
106
 
107
- isTouch = module.setup.testOutTouch();
108
107
  module.setup.layout();
109
108
  module.setup.labels();
110
109
 
@@ -175,14 +174,6 @@ $.fn.slider = function(parameters) {
175
174
  }
176
175
  }
177
176
  },
178
- testOutTouch: function() {
179
- try {
180
- document.createEvent('TouchEvent');
181
- return true;
182
- } catch (e) {
183
- return false;
184
- }
185
- },
186
177
  customLabel: function() {
187
178
  var
188
179
  $children = $labels.find('.label'),
@@ -236,9 +227,6 @@ $.fn.slider = function(parameters) {
236
227
  module.bind.globalKeyboardEvents();
237
228
  module.bind.keyboardEvents();
238
229
  module.bind.mouseEvents();
239
- if(module.is.touch()) {
240
- module.bind.touchEvents();
241
- }
242
230
  if (settings.autoAdjustLabels) {
243
231
  module.bind.windowEvents();
244
232
  }
@@ -251,7 +239,7 @@ $.fn.slider = function(parameters) {
251
239
  $(document).on('keydown' + eventNamespace + documentEventID, module.event.activateFocus);
252
240
  },
253
241
  mouseEvents: function() {
254
- module.verbose('Binding mouse events');
242
+ module.verbose('Binding mouse and touch events');
255
243
  $module.find('.track, .thumb, .inner').on('mousedown' + eventNamespace, function(event) {
256
244
  event.stopImmediatePropagation();
257
245
  event.preventDefault();
@@ -264,27 +252,20 @@ $.fn.slider = function(parameters) {
264
252
  $module.on('mouseleave' + eventNamespace, function(event) {
265
253
  isHover = false;
266
254
  });
267
- },
268
- touchEvents: function() {
269
- module.verbose('Binding touch events');
270
- $module.find('.track, .thumb, .inner').on('touchstart' + eventNamespace, function(event) {
271
- event.stopImmediatePropagation();
272
- event.preventDefault();
273
- module.event.down(event);
274
- });
275
- $module.on('touchstart' + eventNamespace, module.event.down);
255
+ // All touch events are invoked on the element where the touch *started*. Thus, we can bind them all
256
+ // on the thumb(s) and don't need to worry about interference with other components, i.e. no dynamic binding
257
+ // and unbinding required.
258
+ $module.find('.thumb')
259
+ .on('touchstart' + eventNamespace, module.event.touchDown)
260
+ .on('touchmove' + eventNamespace, module.event.move)
261
+ .on('touchend' + eventNamespace, module.event.up)
262
+ .on('touchcancel' + eventNamespace, module.event.touchCancel);
276
263
  },
277
264
  slidingEvents: function() {
278
265
  // these don't need the identifier because we only ever want one of them to be registered with document
279
266
  module.verbose('Binding page wide events while handle is being draged');
280
- if(module.is.touch()) {
281
- $(document).on('touchmove' + eventNamespace, module.event.move);
282
- $(document).on('touchend' + eventNamespace, module.event.up);
283
- }
284
- else {
285
- $(document).on('mousemove' + eventNamespace, module.event.move);
286
- $(document).on('mouseup' + eventNamespace, module.event.up);
287
- }
267
+ $(document).on('mousemove' + eventNamespace, module.event.move);
268
+ $(document).on('mouseup' + eventNamespace, module.event.up);
288
269
  },
289
270
  windowEvents: function() {
290
271
  $window.on('resize' + eventNamespace, module.event.resize);
@@ -294,24 +275,22 @@ $.fn.slider = function(parameters) {
294
275
  unbind: {
295
276
  events: function() {
296
277
  $module.find('.track, .thumb, .inner').off('mousedown' + eventNamespace);
297
- $module.find('.track, .thumb, .inner').off('touchstart' + eventNamespace);
298
278
  $module.off('mousedown' + eventNamespace);
299
279
  $module.off('mouseenter' + eventNamespace);
300
280
  $module.off('mouseleave' + eventNamespace);
301
- $module.off('touchstart' + eventNamespace);
281
+ $module.find('.thumb')
282
+ .off('touchstart' + eventNamespace)
283
+ .off('touchmove' + eventNamespace)
284
+ .off('touchend' + eventNamespace)
285
+ .off('touchcancel' + eventNamespace);
302
286
  $module.off('keydown' + eventNamespace);
303
287
  $module.off('focusout' + eventNamespace);
304
288
  $(document).off('keydown' + eventNamespace + documentEventID, module.event.activateFocus);
305
289
  $window.off('resize' + eventNamespace);
306
290
  },
307
291
  slidingEvents: function() {
308
- if(module.is.touch()) {
309
- $(document).off('touchmove' + eventNamespace);
310
- $(document).off('touchend' + eventNamespace);
311
- } else {
312
- $(document).off('mousemove' + eventNamespace);
313
- $(document).off('mouseup' + eventNamespace);
314
- }
292
+ $(document).off('mousemove' + eventNamespace);
293
+ $(document).off('mouseup' + eventNamespace);
315
294
  },
316
295
  },
317
296
 
@@ -341,10 +320,31 @@ $.fn.slider = function(parameters) {
341
320
  module.bind.slidingEvents();
342
321
  }
343
322
  },
323
+ touchDown: function(event) {
324
+ event.preventDefault(); // disable mouse emulation and touch-scrolling
325
+ event.stopImmediatePropagation();
326
+ if(touchIdentifier !== undefined) {
327
+ // ignore multiple touches on the same slider --
328
+ // we cannot handle changing both thumbs at once due to shared state
329
+ return;
330
+ }
331
+ $currThumb = $(event.target);
332
+ var touchEvent = event.touches ? event : event.originalEvent;
333
+ touchIdentifier = touchEvent.targetTouches[0].identifier;
334
+ if(previousValue === undefined) {
335
+ previousValue = module.get.currentThumbValue();
336
+ }
337
+ },
344
338
  move: function(event) {
345
- event.preventDefault();
339
+ if(event.type == 'mousemove') {
340
+ event.preventDefault(); // prevent text selection etc.
341
+ }
342
+ if(module.is.disabled()) {
343
+ // touch events are always bound, so we need to prevent touch-sliding on disabled sliders here
344
+ return;
345
+ }
346
346
  var value = module.determine.valueFromEvent(event);
347
- if($currThumb === undefined) {
347
+ if(event.type == 'mousemove' && $currThumb === undefined) {
348
348
  var
349
349
  eventPos = module.determine.eventPos(event),
350
350
  newPos = module.determine.pos(eventPos)
@@ -381,13 +381,26 @@ $.fn.slider = function(parameters) {
381
381
  },
382
382
  up: function(event) {
383
383
  event.preventDefault();
384
+ if(module.is.disabled()) {
385
+ // touch events are always bound, so we need to prevent touch-sliding on disabled sliders here
386
+ return;
387
+ }
384
388
  var value = module.determine.valueFromEvent(event);
385
389
  module.set.value(value);
386
390
  module.unbind.slidingEvents();
391
+ touchIdentifier = undefined;
387
392
  if (previousValue !== undefined) {
388
393
  previousValue = undefined;
389
394
  }
390
395
  },
396
+ touchCancel: function(event) {
397
+ event.preventDefault();
398
+ touchIdentifier = undefined;
399
+ if (previousValue !== undefined) {
400
+ module.update.value(previousValue);
401
+ previousValue = undefined;
402
+ }
403
+ },
391
404
  keydown: function(event, first) {
392
405
  if(settings.preventCrossover && module.is.range() && module.thumbVal === module.secondThumbVal) {
393
406
  $currThumb = undefined;
@@ -500,9 +513,6 @@ $.fn.slider = function(parameters) {
500
513
  },
501
514
  smooth: function() {
502
515
  return settings.smooth || $module.hasClass(settings.className.smooth);
503
- },
504
- touch: function() {
505
- return isTouch;
506
516
  }
507
517
  },
508
518
 
@@ -766,12 +776,19 @@ $.fn.slider = function(parameters) {
766
776
  return value;
767
777
  },
768
778
  eventPos: function(event) {
769
- if(module.is.touch()) {
779
+ if(event.type === "touchmove" || event.type === "touchend") {
780
+ var
781
+ touchEvent = event.touches ? event : event.originalEvent,
782
+ touch = touchEvent.changedTouches[0]; // fall back to first touch if correct touch not found
783
+ for(var i=0; i < touchEvent.touches.length; i++) {
784
+ if(touchEvent.touches[i].identifier === touchIdentifier) {
785
+ touch = touchEvent.touches[i];
786
+ break;
787
+ }
788
+ }
770
789
  var
771
- touchEvent = event.changedTouches ? event : event.originalEvent,
772
- touches = touchEvent.changedTouches[0] ? touchEvent.changedTouches : touchEvent.touches,
773
- touchY = touches[0].pageY,
774
- touchX = touches[0].pageX
790
+ touchY = touch.pageY,
791
+ touchX = touch.pageX
775
792
  ;
776
793
  return module.is.vertical() ? touchY : touchX;
777
794
  }