phcthemes_admin_panel_pack 4.0.7 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/README.md +2 -0
  4. data/Rakefile +8 -8
  5. data/app/assets/config/phcthemes_admin_panel_pack_manifest.js +9 -9
  6. data/app/assets/javascripts/common/backstretch/jquery.backstretch.js +1602 -1602
  7. data/app/assets/javascripts/common/bootstrap/bootstrap.bundle.js +7023 -7023
  8. data/app/assets/javascripts/common/bootstrap/bootstrap.three.js +2377 -2377
  9. data/app/assets/javascripts/common/bootstrap-datepicker/bootstrap-datepicker.js +2039 -2039
  10. data/app/assets/javascripts/common/bootstrap-markdown/bootstrap-markdown.js +1390 -1390
  11. data/app/assets/javascripts/common/bootstrap-select/bootstrap-select.js +0 -0
  12. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js +0 -0
  13. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js.map +0 -0
  14. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.min.js +7 -7
  15. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js +0 -0
  16. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js.map +0 -0
  17. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.min.js +7 -7
  18. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js +0 -0
  19. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js.map +0 -0
  20. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.min.js +7 -7
  21. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js +0 -0
  22. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js.map +0 -0
  23. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.min.js +7 -7
  24. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js +0 -0
  25. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js.map +0 -0
  26. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.min.js +7 -7
  27. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js +0 -0
  28. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js.map +0 -0
  29. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.min.js +7 -7
  30. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js +0 -0
  31. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js.map +0 -0
  32. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.min.js +7 -7
  33. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js +0 -0
  34. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js.map +0 -0
  35. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.min.js +7 -7
  36. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js +0 -0
  37. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js.map +0 -0
  38. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.min.js +7 -7
  39. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js +0 -0
  40. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js.map +0 -0
  41. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.min.js +7 -7
  42. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js +0 -0
  43. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js.map +0 -0
  44. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.min.js +7 -7
  45. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js +0 -0
  46. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js.map +0 -0
  47. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.min.js +7 -7
  48. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js +0 -0
  49. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js.map +0 -0
  50. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.min.js +7 -7
  51. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js +0 -0
  52. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js.map +0 -0
  53. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.min.js +7 -7
  54. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js +0 -0
  55. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js.map +0 -0
  56. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.min.js +7 -7
  57. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js +0 -0
  58. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js.map +0 -0
  59. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.min.js +7 -7
  60. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js +0 -0
  61. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js.map +0 -0
  62. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.min.js +7 -7
  63. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js +0 -0
  64. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js.map +0 -0
  65. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.min.js +7 -7
  66. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js +0 -0
  67. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js.map +0 -0
  68. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.min.js +7 -7
  69. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js +0 -0
  70. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js.map +0 -0
  71. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.min.js +7 -7
  72. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js +0 -0
  73. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js.map +0 -0
  74. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.min.js +7 -7
  75. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js +0 -0
  76. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js.map +0 -0
  77. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.min.js +7 -7
  78. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js +0 -0
  79. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js.map +0 -0
  80. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.min.js +7 -7
  81. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js +0 -0
  82. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js.map +0 -0
  83. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.min.js +7 -7
  84. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js +0 -0
  85. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js.map +0 -0
  86. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.min.js +7 -7
  87. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js +0 -0
  88. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js.map +0 -0
  89. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.min.js +7 -7
  90. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js +0 -0
  91. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js.map +0 -0
  92. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.min.js +7 -7
  93. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js +0 -0
  94. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js.map +0 -0
  95. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.min.js +7 -7
  96. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js +0 -0
  97. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js.map +0 -0
  98. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.min.js +7 -7
  99. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js +0 -0
  100. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js.map +0 -0
  101. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.min.js +7 -7
  102. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js +0 -0
  103. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js.map +0 -0
  104. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.min.js +7 -7
  105. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js +0 -0
  106. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js.map +0 -0
  107. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.min.js +7 -7
  108. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js +0 -0
  109. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js.map +0 -0
  110. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.min.js +7 -7
  111. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js +0 -0
  112. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js.map +0 -0
  113. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.min.js +7 -7
  114. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js +0 -0
  115. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js.map +0 -0
  116. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.min.js +7 -7
  117. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js +0 -0
  118. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js.map +0 -0
  119. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.min.js +7 -7
  120. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js +0 -0
  121. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js.map +0 -0
  122. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.min.js +7 -7
  123. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js +0 -0
  124. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js.map +0 -0
  125. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.min.js +7 -7
  126. data/app/assets/javascripts/common/chartjs/chart.js +0 -0
  127. data/app/assets/javascripts/common/ckeditor/ckeditor.js +6 -6
  128. data/app/assets/javascripts/common/ckeditor/ckeditor.js.map +0 -0
  129. data/app/assets/javascripts/common/ckeditor/translations/af.js +0 -0
  130. data/app/assets/javascripts/common/ckeditor/translations/ar.js +0 -0
  131. data/app/assets/javascripts/common/ckeditor/translations/ast.js +0 -0
  132. data/app/assets/javascripts/common/ckeditor/translations/az.js +0 -0
  133. data/app/assets/javascripts/common/ckeditor/translations/bg.js +0 -0
  134. data/app/assets/javascripts/common/ckeditor/translations/ca.js +0 -0
  135. data/app/assets/javascripts/common/ckeditor/translations/cs.js +0 -0
  136. data/app/assets/javascripts/common/ckeditor/translations/da.js +0 -0
  137. data/app/assets/javascripts/common/ckeditor/translations/de-ch.js +0 -0
  138. data/app/assets/javascripts/common/ckeditor/translations/de.js +0 -0
  139. data/app/assets/javascripts/common/ckeditor/translations/el.js +0 -0
  140. data/app/assets/javascripts/common/ckeditor/translations/en-au.js +0 -0
  141. data/app/assets/javascripts/common/ckeditor/translations/en-gb.js +0 -0
  142. data/app/assets/javascripts/common/ckeditor/translations/eo.js +0 -0
  143. data/app/assets/javascripts/common/ckeditor/translations/es.js +0 -0
  144. data/app/assets/javascripts/common/ckeditor/translations/et.js +0 -0
  145. data/app/assets/javascripts/common/ckeditor/translations/eu.js +0 -0
  146. data/app/assets/javascripts/common/ckeditor/translations/fa.js +0 -0
  147. data/app/assets/javascripts/common/ckeditor/translations/fi.js +0 -0
  148. data/app/assets/javascripts/common/ckeditor/translations/fr.js +0 -0
  149. data/app/assets/javascripts/common/ckeditor/translations/gl.js +0 -0
  150. data/app/assets/javascripts/common/ckeditor/translations/gu.js +0 -0
  151. data/app/assets/javascripts/common/ckeditor/translations/he.js +0 -0
  152. data/app/assets/javascripts/common/ckeditor/translations/hr.js +0 -0
  153. data/app/assets/javascripts/common/ckeditor/translations/hu.js +0 -0
  154. data/app/assets/javascripts/common/ckeditor/translations/id.js +0 -0
  155. data/app/assets/javascripts/common/ckeditor/translations/it.js +0 -0
  156. data/app/assets/javascripts/common/ckeditor/translations/ja.js +0 -0
  157. data/app/assets/javascripts/common/ckeditor/translations/km.js +0 -0
  158. data/app/assets/javascripts/common/ckeditor/translations/kn.js +0 -0
  159. data/app/assets/javascripts/common/ckeditor/translations/ko.js +0 -0
  160. data/app/assets/javascripts/common/ckeditor/translations/ku.js +0 -0
  161. data/app/assets/javascripts/common/ckeditor/translations/lt.js +0 -0
  162. data/app/assets/javascripts/common/ckeditor/translations/lv.js +0 -0
  163. data/app/assets/javascripts/common/ckeditor/translations/nb.js +0 -0
  164. data/app/assets/javascripts/common/ckeditor/translations/ne.js +0 -0
  165. data/app/assets/javascripts/common/ckeditor/translations/nl.js +0 -0
  166. data/app/assets/javascripts/common/ckeditor/translations/no.js +0 -0
  167. data/app/assets/javascripts/common/ckeditor/translations/oc.js +0 -0
  168. data/app/assets/javascripts/common/ckeditor/translations/pl.js +0 -0
  169. data/app/assets/javascripts/common/ckeditor/translations/pt-br.js +0 -0
  170. data/app/assets/javascripts/common/ckeditor/translations/pt.js +0 -0
  171. data/app/assets/javascripts/common/ckeditor/translations/ro.js +0 -0
  172. data/app/assets/javascripts/common/ckeditor/translations/ru.js +0 -0
  173. data/app/assets/javascripts/common/ckeditor/translations/si.js +0 -0
  174. data/app/assets/javascripts/common/ckeditor/translations/sk.js +0 -0
  175. data/app/assets/javascripts/common/ckeditor/translations/sl.js +0 -0
  176. data/app/assets/javascripts/common/ckeditor/translations/sq.js +0 -0
  177. data/app/assets/javascripts/common/ckeditor/translations/sr-latn.js +0 -0
  178. data/app/assets/javascripts/common/ckeditor/translations/sr.js +0 -0
  179. data/app/assets/javascripts/common/ckeditor/translations/sv.js +0 -0
  180. data/app/assets/javascripts/common/ckeditor/translations/th.js +0 -0
  181. data/app/assets/javascripts/common/ckeditor/translations/tr.js +0 -0
  182. data/app/assets/javascripts/common/ckeditor/translations/tt.js +0 -0
  183. data/app/assets/javascripts/common/ckeditor/translations/ug.js +0 -0
  184. data/app/assets/javascripts/common/ckeditor/translations/uk.js +0 -0
  185. data/app/assets/javascripts/common/ckeditor/translations/vi.js +0 -0
  186. data/app/assets/javascripts/common/ckeditor/translations/zh-cn.js +0 -0
  187. data/app/assets/javascripts/common/ckeditor/translations/zh.js +0 -0
  188. data/app/assets/javascripts/common/clipboardjs/clipboard.js +977 -977
  189. data/app/assets/javascripts/common/covervid/covervid.js +94 -94
  190. data/app/assets/javascripts/common/custom/custom.js +0 -0
  191. data/app/assets/javascripts/common/datatables/datatables.js +15310 -15310
  192. data/app/assets/javascripts/common/daterangepicker/daterangepicker.js +1565 -1565
  193. data/app/assets/javascripts/common/fastclick/fastclick.js +841 -841
  194. data/app/assets/javascripts/common/flexslider/jquery.flexslider.js +1252 -1252
  195. data/app/assets/javascripts/common/greenstock/greensock.js +35 -35
  196. data/app/assets/javascripts/common/html5sortable/jquery.sortable.js +98 -98
  197. data/app/assets/javascripts/common/icheck/icheck.js +509 -509
  198. data/app/assets/javascripts/common/imagesloaded/imagesloaded.pkgd.js +497 -497
  199. data/app/assets/javascripts/common/isotope/isotope.pkgd.js +3563 -3563
  200. data/app/assets/javascripts/common/jquery/jquery-3.4.1.js +10598 -10598
  201. data/app/assets/javascripts/common/jquery-countdown/jquery.countdown.js +245 -245
  202. data/app/assets/javascripts/common/jquery-filterizer/jquery.filterizr.min.js +0 -0
  203. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.autogrow.js +37 -37
  204. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.charcounter.js +53 -53
  205. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.checkbox.js +54 -54
  206. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.datepicker.js +59 -59
  207. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.js +823 -823
  208. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.masked.js +46 -46
  209. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.time.js +71 -71
  210. data/app/assets/javascripts/common/jquery-jvectormap/jquery-jvectormap.js +44 -44
  211. data/app/assets/javascripts/common/jquery-placeholder/jquery.placeholder.js +281 -281
  212. data/app/assets/javascripts/common/jquery-slimscroll/jquery.slimscroll.js +474 -474
  213. data/app/assets/javascripts/common/jquery-sparkline/jquery.sparkline.js +3054 -3054
  214. data/app/assets/javascripts/common/jquery-ui/jquery-ui.js +18705 -18705
  215. data/app/assets/javascripts/common/jquery-validation/jquery.validate.js +0 -0
  216. data/app/assets/javascripts/common/jqvmap/jquery.vmap.js +1281 -1281
  217. data/app/assets/javascripts/common/jqvmap/jquery.vmap.min.js +9 -9
  218. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.africa.js +2 -2
  219. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.asia.js +2 -2
  220. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.australia.js +2 -2
  221. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.europe.js +2 -2
  222. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.north-america.js +2 -2
  223. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.south-america.js +2 -2
  224. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.algeria.js +2 -2
  225. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.argentina.js +1 -1
  226. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.brazil.js +2 -2
  227. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.canada.js +1 -1
  228. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.europe.js +2 -2
  229. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.france.js +1 -1
  230. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.germany.js +2 -2
  231. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.greece.js +1 -1
  232. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iran.js +6 -6
  233. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iraq.js +1 -1
  234. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.russia.js +2 -2
  235. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.tunisia.js +2 -2
  236. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.turkey.js +11 -11
  237. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.usa.js +2 -2
  238. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.world.js +2 -2
  239. data/app/assets/javascripts/common/js-cookie/js.cookie.js +165 -165
  240. data/app/assets/javascripts/common/layerslider/layerslider.kreaturamedia.jquery.js +12 -12
  241. data/app/assets/javascripts/common/layerslider/layerslider.origami.js +12 -12
  242. data/app/assets/javascripts/common/layerslider/layerslider.timeline.js +12 -12
  243. data/app/assets/javascripts/common/layerslider/layerslider.transitions.js +12 -12
  244. data/app/assets/javascripts/common/lazysizes/lazysizes.js +754 -754
  245. data/app/assets/javascripts/common/leaflet/leaflet.js +4 -4
  246. data/app/assets/javascripts/common/magnific-popup/jquery.magnific-popup.js +1859 -1859
  247. data/app/assets/javascripts/common/mapbox/mapbox.js +51 -51
  248. data/app/assets/javascripts/common/metismenu/metisMenu.js +340 -340
  249. data/app/assets/javascripts/common/moderizer/modernizr.js +11 -11
  250. data/app/assets/javascripts/common/nouislider/nouislider.js +2637 -2637
  251. data/app/assets/javascripts/common/owl-carousel/owl.carousel.js +3448 -3448
  252. data/app/assets/javascripts/common/pace/pace.js +935 -935
  253. data/app/assets/javascripts/common/paroller/jquery.paroller.js +228 -228
  254. data/app/assets/javascripts/common/particlejs/particles.js +1540 -1540
  255. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.common.js +1318 -1318
  256. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.esm.js +1316 -1316
  257. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.js +1324 -1324
  258. data/app/assets/javascripts/common/plyr/plyr.js +9137 -9137
  259. data/app/assets/javascripts/common/rangeslider/rangeslider.js +498 -498
  260. data/app/assets/javascripts/common/retina/retina.js +100 -100
  261. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.actions.js +0 -0
  262. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.carousel.js +0 -0
  263. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.kenburn.js +0 -0
  264. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.layeranimation.js +0 -0
  265. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.migration.js +0 -0
  266. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.navigation.js +0 -0
  267. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.parallax.js +0 -0
  268. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.slideanims.js +0 -0
  269. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.video.js +0 -0
  270. data/app/assets/javascripts/common/rev-slider/jquery.themepunch.revolution.js +0 -0
  271. data/app/assets/javascripts/common/rev-slider/jquery.themepunch.tools.min.js +0 -0
  272. data/app/assets/javascripts/common/scrollme/jquery.scrollme.js +455 -455
  273. data/app/assets/javascripts/common/scrollup/jquery.scrollUp.js +168 -168
  274. data/app/assets/javascripts/common/select2/select2.full.js +6597 -6597
  275. data/app/assets/javascripts/common/selectbox/jquery.selectBox.js +1091 -1091
  276. data/app/assets/javascripts/common/slick/slick.js +3004 -3004
  277. data/app/assets/javascripts/common/smooth-scroll/SmoothScroll.js +788 -788
  278. data/app/assets/javascripts/common/spectrum/spectrum.js +2323 -2323
  279. data/app/assets/javascripts/common/stepper/jquery.fs.stepper.js +339 -339
  280. data/app/assets/javascripts/common/swiper/swiper.js +8124 -8124
  281. data/app/assets/javascripts/common/toaster/toastr.js +476 -476
  282. data/app/assets/javascripts/common/typed/typed.js +1044 -1044
  283. data/app/assets/javascripts/common/visable/jquery.visible.js +68 -68
  284. data/app/assets/javascripts/common/waypoints/jquery.waypoints.js +661 -661
  285. data/app/assets/javascripts/common/wow/wow.js +508 -508
  286. data/app/assets/javascripts/phcthemes_admin_panel_pack_adminlte.js +12 -12
  287. data/app/assets/javascripts/phcthemes_admin_panel_pack_boomerang.js +0 -0
  288. data/app/assets/javascripts/phcthemes_admin_panel_pack_coloradmin.js +5 -5
  289. data/app/assets/javascripts/phcthemes_admin_panel_pack_inspinia.js +10 -10
  290. data/app/assets/javascripts/phcthemes_admin_panel_pack_metronic.js +6 -6
  291. data/app/assets/javascripts/phcthemes_admin_panel_pack_quilpro.js +5 -5
  292. data/app/assets/javascripts/phcthemes_admin_panel_pack_starlight.js +5 -5
  293. data/app/assets/javascripts/themes/adminlte/theme/adminlte.js +1141 -1141
  294. data/app/assets/javascripts/themes/coloradmin/theme/color_admin_app.min.js +0 -0
  295. data/app/assets/javascripts/themes/coloradmin/theme/color_admin_default.js +0 -0
  296. data/app/assets/javascripts/themes/inspinia/theme/inspinia.js +279 -279
  297. data/app/assets/javascripts/themes/metronic/theme/plugins.bundle.js +0 -0
  298. data/app/assets/javascripts/themes/metronic/theme/prismjs.bundle.js +1922 -1922
  299. data/app/assets/javascripts/themes/metronic/theme/scripts.bundle.js +0 -0
  300. data/app/assets/javascripts/themes/metronic/theme/widgets.js +0 -0
  301. data/app/assets/stylesheets/common/hanna_hearts/hanna_hearts.scss +0 -0
  302. data/app/assets/stylesheets/phcthemes_admin_panel_pack_adminlte.scss +16 -16
  303. data/app/assets/stylesheets/phcthemes_admin_panel_pack_boomerang.scss +27 -27
  304. data/app/assets/stylesheets/phcthemes_admin_panel_pack_coloradmin.scss +11 -11
  305. data/app/assets/stylesheets/phcthemes_admin_panel_pack_inspinia.scss +18 -18
  306. data/app/assets/stylesheets/phcthemes_admin_panel_pack_metronic.scss +15 -15
  307. data/app/assets/stylesheets/phcthemes_admin_panel_pack_quilpro.scss +19 -19
  308. data/app/assets/stylesheets/phcthemes_admin_panel_pack_starlight.scss +15 -15
  309. data/lib/phcthemes_admin_panel_pack/engine.rb +20 -20
  310. data/lib/phcthemes_admin_panel_pack/version.rb +3 -3
  311. data/lib/phcthemes_admin_panel_pack.rb +6 -6
  312. data/lib/tasks/phcthemes_admin_panel_pack_tasks.rake +4 -4
  313. metadata +3 -3
@@ -1,1318 +1,1318 @@
1
- /*!
2
- * perfect-scrollbar v1.4.0
3
- * (c) 2018 Hyunje Jun
4
- * @license MIT
5
- */
6
- 'use strict';
7
-
8
- function get(element) {
9
- return getComputedStyle(element);
10
- }
11
-
12
- function set(element, obj) {
13
- for (var key in obj) {
14
- var val = obj[key];
15
- if (typeof val === 'number') {
16
- val = val + "px";
17
- }
18
- element.style[key] = val;
19
- }
20
- return element;
21
- }
22
-
23
- function div(className) {
24
- var div = document.createElement('div');
25
- div.className = className;
26
- return div;
27
- }
28
-
29
- var elMatches =
30
- typeof Element !== 'undefined' &&
31
- (Element.prototype.matches ||
32
- Element.prototype.webkitMatchesSelector ||
33
- Element.prototype.mozMatchesSelector ||
34
- Element.prototype.msMatchesSelector);
35
-
36
- function matches(element, query) {
37
- if (!elMatches) {
38
- throw new Error('No element matching method supported');
39
- }
40
-
41
- return elMatches.call(element, query);
42
- }
43
-
44
- function remove(element) {
45
- if (element.remove) {
46
- element.remove();
47
- } else {
48
- if (element.parentNode) {
49
- element.parentNode.removeChild(element);
50
- }
51
- }
52
- }
53
-
54
- function queryChildren(element, selector) {
55
- return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
56
- );
57
- }
58
-
59
- var cls = {
60
- main: 'ps',
61
- element: {
62
- thumb: function (x) { return ("ps__thumb-" + x); },
63
- rail: function (x) { return ("ps__rail-" + x); },
64
- consuming: 'ps__child--consume',
65
- },
66
- state: {
67
- focus: 'ps--focus',
68
- clicking: 'ps--clicking',
69
- active: function (x) { return ("ps--active-" + x); },
70
- scrolling: function (x) { return ("ps--scrolling-" + x); },
71
- },
72
- };
73
-
74
- /*
75
- * Helper methods
76
- */
77
- var scrollingClassTimeout = { x: null, y: null };
78
-
79
- function addScrollingClass(i, x) {
80
- var classList = i.element.classList;
81
- var className = cls.state.scrolling(x);
82
-
83
- if (classList.contains(className)) {
84
- clearTimeout(scrollingClassTimeout[x]);
85
- } else {
86
- classList.add(className);
87
- }
88
- }
89
-
90
- function removeScrollingClass(i, x) {
91
- scrollingClassTimeout[x] = setTimeout(
92
- function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
93
- i.settings.scrollingThreshold
94
- );
95
- }
96
-
97
- function setScrollingClassInstantly(i, x) {
98
- addScrollingClass(i, x);
99
- removeScrollingClass(i, x);
100
- }
101
-
102
- var EventElement = function EventElement(element) {
103
- this.element = element;
104
- this.handlers = {};
105
- };
106
-
107
- var prototypeAccessors = { isEmpty: { configurable: true } };
108
-
109
- EventElement.prototype.bind = function bind (eventName, handler) {
110
- if (typeof this.handlers[eventName] === 'undefined') {
111
- this.handlers[eventName] = [];
112
- }
113
- this.handlers[eventName].push(handler);
114
- this.element.addEventListener(eventName, handler, false);
115
- };
116
-
117
- EventElement.prototype.unbind = function unbind (eventName, target) {
118
- var this$1 = this;
119
-
120
- this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
121
- if (target && handler !== target) {
122
- return true;
123
- }
124
- this$1.element.removeEventListener(eventName, handler, false);
125
- return false;
126
- });
127
- };
128
-
129
- EventElement.prototype.unbindAll = function unbindAll () {
130
- var this$1 = this;
131
-
132
- for (var name in this$1.handlers) {
133
- this$1.unbind(name);
134
- }
135
- };
136
-
137
- prototypeAccessors.isEmpty.get = function () {
138
- var this$1 = this;
139
-
140
- return Object.keys(this.handlers).every(
141
- function (key) { return this$1.handlers[key].length === 0; }
142
- );
143
- };
144
-
145
- Object.defineProperties( EventElement.prototype, prototypeAccessors );
146
-
147
- var EventManager = function EventManager() {
148
- this.eventElements = [];
149
- };
150
-
151
- EventManager.prototype.eventElement = function eventElement (element) {
152
- var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
153
- if (!ee) {
154
- ee = new EventElement(element);
155
- this.eventElements.push(ee);
156
- }
157
- return ee;
158
- };
159
-
160
- EventManager.prototype.bind = function bind (element, eventName, handler) {
161
- this.eventElement(element).bind(eventName, handler);
162
- };
163
-
164
- EventManager.prototype.unbind = function unbind (element, eventName, handler) {
165
- var ee = this.eventElement(element);
166
- ee.unbind(eventName, handler);
167
-
168
- if (ee.isEmpty) {
169
- // remove
170
- this.eventElements.splice(this.eventElements.indexOf(ee), 1);
171
- }
172
- };
173
-
174
- EventManager.prototype.unbindAll = function unbindAll () {
175
- this.eventElements.forEach(function (e) { return e.unbindAll(); });
176
- this.eventElements = [];
177
- };
178
-
179
- EventManager.prototype.once = function once (element, eventName, handler) {
180
- var ee = this.eventElement(element);
181
- var onceHandler = function (evt) {
182
- ee.unbind(eventName, onceHandler);
183
- handler(evt);
184
- };
185
- ee.bind(eventName, onceHandler);
186
- };
187
-
188
- function createEvent(name) {
189
- if (typeof window.CustomEvent === 'function') {
190
- return new CustomEvent(name);
191
- } else {
192
- var evt = document.createEvent('CustomEvent');
193
- evt.initCustomEvent(name, false, false, undefined);
194
- return evt;
195
- }
196
- }
197
-
198
- var processScrollDiff = function(
199
- i,
200
- axis,
201
- diff,
202
- useScrollingClass,
203
- forceFireReachEvent
204
- ) {
205
- if ( useScrollingClass === void 0 ) useScrollingClass = true;
206
- if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
207
-
208
- var fields;
209
- if (axis === 'top') {
210
- fields = [
211
- 'contentHeight',
212
- 'containerHeight',
213
- 'scrollTop',
214
- 'y',
215
- 'up',
216
- 'down' ];
217
- } else if (axis === 'left') {
218
- fields = [
219
- 'contentWidth',
220
- 'containerWidth',
221
- 'scrollLeft',
222
- 'x',
223
- 'left',
224
- 'right' ];
225
- } else {
226
- throw new Error('A proper axis should be provided');
227
- }
228
-
229
- processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
230
- };
231
-
232
- function processScrollDiff$1(
233
- i,
234
- diff,
235
- ref,
236
- useScrollingClass,
237
- forceFireReachEvent
238
- ) {
239
- var contentHeight = ref[0];
240
- var containerHeight = ref[1];
241
- var scrollTop = ref[2];
242
- var y = ref[3];
243
- var up = ref[4];
244
- var down = ref[5];
245
- if ( useScrollingClass === void 0 ) useScrollingClass = true;
246
- if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
247
-
248
- var element = i.element;
249
-
250
- // reset reach
251
- i.reach[y] = null;
252
-
253
- // 1 for subpixel rounding
254
- if (element[scrollTop] < 1) {
255
- i.reach[y] = 'start';
256
- }
257
-
258
- // 1 for subpixel rounding
259
- if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
260
- i.reach[y] = 'end';
261
- }
262
-
263
- if (diff) {
264
- element.dispatchEvent(createEvent(("ps-scroll-" + y)));
265
-
266
- if (diff < 0) {
267
- element.dispatchEvent(createEvent(("ps-scroll-" + up)));
268
- } else if (diff > 0) {
269
- element.dispatchEvent(createEvent(("ps-scroll-" + down)));
270
- }
271
-
272
- if (useScrollingClass) {
273
- setScrollingClassInstantly(i, y);
274
- }
275
- }
276
-
277
- if (i.reach[y] && (diff || forceFireReachEvent)) {
278
- element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
279
- }
280
- }
281
-
282
- function toInt(x) {
283
- return parseInt(x, 10) || 0;
284
- }
285
-
286
- function isEditable(el) {
287
- return (
288
- matches(el, 'input,[contenteditable]') ||
289
- matches(el, 'select,[contenteditable]') ||
290
- matches(el, 'textarea,[contenteditable]') ||
291
- matches(el, 'button,[contenteditable]')
292
- );
293
- }
294
-
295
- function outerWidth(element) {
296
- var styles = get(element);
297
- return (
298
- toInt(styles.width) +
299
- toInt(styles.paddingLeft) +
300
- toInt(styles.paddingRight) +
301
- toInt(styles.borderLeftWidth) +
302
- toInt(styles.borderRightWidth)
303
- );
304
- }
305
-
306
- var env = {
307
- isWebKit:
308
- typeof document !== 'undefined' &&
309
- 'WebkitAppearance' in document.documentElement.style,
310
- supportsTouch:
311
- typeof window !== 'undefined' &&
312
- ('ontouchstart' in window ||
313
- (window.DocumentTouch && document instanceof window.DocumentTouch)),
314
- supportsIePointer:
315
- typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
316
- isChrome:
317
- typeof navigator !== 'undefined' &&
318
- /Chrome/i.test(navigator && navigator.userAgent),
319
- };
320
-
321
- var updateGeometry = function(i) {
322
- var element = i.element;
323
- var roundedScrollTop = Math.floor(element.scrollTop);
324
-
325
- i.containerWidth = element.clientWidth;
326
- i.containerHeight = element.clientHeight;
327
- i.contentWidth = element.scrollWidth;
328
- i.contentHeight = element.scrollHeight;
329
-
330
- if (!element.contains(i.scrollbarXRail)) {
331
- // clean up and append
332
- queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
333
- );
334
- element.appendChild(i.scrollbarXRail);
335
- }
336
- if (!element.contains(i.scrollbarYRail)) {
337
- // clean up and append
338
- queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
339
- );
340
- element.appendChild(i.scrollbarYRail);
341
- }
342
-
343
- if (
344
- !i.settings.suppressScrollX &&
345
- i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
346
- ) {
347
- i.scrollbarXActive = true;
348
- i.railXWidth = i.containerWidth - i.railXMarginWidth;
349
- i.railXRatio = i.containerWidth / i.railXWidth;
350
- i.scrollbarXWidth = getThumbSize(
351
- i,
352
- toInt(i.railXWidth * i.containerWidth / i.contentWidth)
353
- );
354
- i.scrollbarXLeft = toInt(
355
- (i.negativeScrollAdjustment + element.scrollLeft) *
356
- (i.railXWidth - i.scrollbarXWidth) /
357
- (i.contentWidth - i.containerWidth)
358
- );
359
- } else {
360
- i.scrollbarXActive = false;
361
- }
362
-
363
- if (
364
- !i.settings.suppressScrollY &&
365
- i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
366
- ) {
367
- i.scrollbarYActive = true;
368
- i.railYHeight = i.containerHeight - i.railYMarginHeight;
369
- i.railYRatio = i.containerHeight / i.railYHeight;
370
- i.scrollbarYHeight = getThumbSize(
371
- i,
372
- toInt(i.railYHeight * i.containerHeight / i.contentHeight)
373
- );
374
- i.scrollbarYTop = toInt(
375
- roundedScrollTop *
376
- (i.railYHeight - i.scrollbarYHeight) /
377
- (i.contentHeight - i.containerHeight)
378
- );
379
- } else {
380
- i.scrollbarYActive = false;
381
- }
382
-
383
- if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
384
- i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
385
- }
386
- if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
387
- i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
388
- }
389
-
390
- updateCss(element, i);
391
-
392
- if (i.scrollbarXActive) {
393
- element.classList.add(cls.state.active('x'));
394
- } else {
395
- element.classList.remove(cls.state.active('x'));
396
- i.scrollbarXWidth = 0;
397
- i.scrollbarXLeft = 0;
398
- element.scrollLeft = 0;
399
- }
400
- if (i.scrollbarYActive) {
401
- element.classList.add(cls.state.active('y'));
402
- } else {
403
- element.classList.remove(cls.state.active('y'));
404
- i.scrollbarYHeight = 0;
405
- i.scrollbarYTop = 0;
406
- element.scrollTop = 0;
407
- }
408
- };
409
-
410
- function getThumbSize(i, thumbSize) {
411
- if (i.settings.minScrollbarLength) {
412
- thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
413
- }
414
- if (i.settings.maxScrollbarLength) {
415
- thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
416
- }
417
- return thumbSize;
418
- }
419
-
420
- function updateCss(element, i) {
421
- var xRailOffset = { width: i.railXWidth };
422
- var roundedScrollTop = Math.floor(element.scrollTop);
423
-
424
- if (i.isRtl) {
425
- xRailOffset.left =
426
- i.negativeScrollAdjustment +
427
- element.scrollLeft +
428
- i.containerWidth -
429
- i.contentWidth;
430
- } else {
431
- xRailOffset.left = element.scrollLeft;
432
- }
433
- if (i.isScrollbarXUsingBottom) {
434
- xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
435
- } else {
436
- xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
437
- }
438
- set(i.scrollbarXRail, xRailOffset);
439
-
440
- var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
441
- if (i.isScrollbarYUsingRight) {
442
- if (i.isRtl) {
443
- yRailOffset.right =
444
- i.contentWidth -
445
- (i.negativeScrollAdjustment + element.scrollLeft) -
446
- i.scrollbarYRight -
447
- i.scrollbarYOuterWidth;
448
- } else {
449
- yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
450
- }
451
- } else {
452
- if (i.isRtl) {
453
- yRailOffset.left =
454
- i.negativeScrollAdjustment +
455
- element.scrollLeft +
456
- i.containerWidth * 2 -
457
- i.contentWidth -
458
- i.scrollbarYLeft -
459
- i.scrollbarYOuterWidth;
460
- } else {
461
- yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
462
- }
463
- }
464
- set(i.scrollbarYRail, yRailOffset);
465
-
466
- set(i.scrollbarX, {
467
- left: i.scrollbarXLeft,
468
- width: i.scrollbarXWidth - i.railBorderXWidth,
469
- });
470
- set(i.scrollbarY, {
471
- top: i.scrollbarYTop,
472
- height: i.scrollbarYHeight - i.railBorderYWidth,
473
- });
474
- }
475
-
476
- var clickRail = function(i) {
477
- i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
478
- i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
479
- var positionTop =
480
- e.pageY -
481
- window.pageYOffset -
482
- i.scrollbarYRail.getBoundingClientRect().top;
483
- var direction = positionTop > i.scrollbarYTop ? 1 : -1;
484
-
485
- i.element.scrollTop += direction * i.containerHeight;
486
- updateGeometry(i);
487
-
488
- e.stopPropagation();
489
- });
490
-
491
- i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
492
- i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
493
- var positionLeft =
494
- e.pageX -
495
- window.pageXOffset -
496
- i.scrollbarXRail.getBoundingClientRect().left;
497
- var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
498
-
499
- i.element.scrollLeft += direction * i.containerWidth;
500
- updateGeometry(i);
501
-
502
- e.stopPropagation();
503
- });
504
- };
505
-
506
- var dragThumb = function(i) {
507
- bindMouseScrollHandler(i, [
508
- 'containerWidth',
509
- 'contentWidth',
510
- 'pageX',
511
- 'railXWidth',
512
- 'scrollbarX',
513
- 'scrollbarXWidth',
514
- 'scrollLeft',
515
- 'x',
516
- 'scrollbarXRail' ]);
517
- bindMouseScrollHandler(i, [
518
- 'containerHeight',
519
- 'contentHeight',
520
- 'pageY',
521
- 'railYHeight',
522
- 'scrollbarY',
523
- 'scrollbarYHeight',
524
- 'scrollTop',
525
- 'y',
526
- 'scrollbarYRail' ]);
527
- };
528
-
529
- function bindMouseScrollHandler(
530
- i,
531
- ref
532
- ) {
533
- var containerHeight = ref[0];
534
- var contentHeight = ref[1];
535
- var pageY = ref[2];
536
- var railYHeight = ref[3];
537
- var scrollbarY = ref[4];
538
- var scrollbarYHeight = ref[5];
539
- var scrollTop = ref[6];
540
- var y = ref[7];
541
- var scrollbarYRail = ref[8];
542
-
543
- var element = i.element;
544
-
545
- var startingScrollTop = null;
546
- var startingMousePageY = null;
547
- var scrollBy = null;
548
-
549
- function mouseMoveHandler(e) {
550
- element[scrollTop] =
551
- startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
552
- addScrollingClass(i, y);
553
- updateGeometry(i);
554
-
555
- e.stopPropagation();
556
- e.preventDefault();
557
- }
558
-
559
- function mouseUpHandler() {
560
- removeScrollingClass(i, y);
561
- i[scrollbarYRail].classList.remove(cls.state.clicking);
562
- i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
563
- }
564
-
565
- i.event.bind(i[scrollbarY], 'mousedown', function (e) {
566
- startingScrollTop = element[scrollTop];
567
- startingMousePageY = e[pageY];
568
- scrollBy =
569
- (i[contentHeight] - i[containerHeight]) /
570
- (i[railYHeight] - i[scrollbarYHeight]);
571
-
572
- i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
573
- i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
574
-
575
- i[scrollbarYRail].classList.add(cls.state.clicking);
576
-
577
- e.stopPropagation();
578
- e.preventDefault();
579
- });
580
- }
581
-
582
- var keyboard = function(i) {
583
- var element = i.element;
584
-
585
- var elementHovered = function () { return matches(element, ':hover'); };
586
- var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
587
-
588
- function shouldPreventDefault(deltaX, deltaY) {
589
- var scrollTop = Math.floor(element.scrollTop);
590
- if (deltaX === 0) {
591
- if (!i.scrollbarYActive) {
592
- return false;
593
- }
594
- if (
595
- (scrollTop === 0 && deltaY > 0) ||
596
- (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
597
- ) {
598
- return !i.settings.wheelPropagation;
599
- }
600
- }
601
-
602
- var scrollLeft = element.scrollLeft;
603
- if (deltaY === 0) {
604
- if (!i.scrollbarXActive) {
605
- return false;
606
- }
607
- if (
608
- (scrollLeft === 0 && deltaX < 0) ||
609
- (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
610
- ) {
611
- return !i.settings.wheelPropagation;
612
- }
613
- }
614
- return true;
615
- }
616
-
617
- i.event.bind(i.ownerDocument, 'keydown', function (e) {
618
- if (
619
- (e.isDefaultPrevented && e.isDefaultPrevented()) ||
620
- e.defaultPrevented
621
- ) {
622
- return;
623
- }
624
-
625
- if (!elementHovered() && !scrollbarFocused()) {
626
- return;
627
- }
628
-
629
- var activeElement = document.activeElement
630
- ? document.activeElement
631
- : i.ownerDocument.activeElement;
632
- if (activeElement) {
633
- if (activeElement.tagName === 'IFRAME') {
634
- activeElement = activeElement.contentDocument.activeElement;
635
- } else {
636
- // go deeper if element is a webcomponent
637
- while (activeElement.shadowRoot) {
638
- activeElement = activeElement.shadowRoot.activeElement;
639
- }
640
- }
641
- if (isEditable(activeElement)) {
642
- return;
643
- }
644
- }
645
-
646
- var deltaX = 0;
647
- var deltaY = 0;
648
-
649
- switch (e.which) {
650
- case 37: // left
651
- if (e.metaKey) {
652
- deltaX = -i.contentWidth;
653
- } else if (e.altKey) {
654
- deltaX = -i.containerWidth;
655
- } else {
656
- deltaX = -30;
657
- }
658
- break;
659
- case 38: // up
660
- if (e.metaKey) {
661
- deltaY = i.contentHeight;
662
- } else if (e.altKey) {
663
- deltaY = i.containerHeight;
664
- } else {
665
- deltaY = 30;
666
- }
667
- break;
668
- case 39: // right
669
- if (e.metaKey) {
670
- deltaX = i.contentWidth;
671
- } else if (e.altKey) {
672
- deltaX = i.containerWidth;
673
- } else {
674
- deltaX = 30;
675
- }
676
- break;
677
- case 40: // down
678
- if (e.metaKey) {
679
- deltaY = -i.contentHeight;
680
- } else if (e.altKey) {
681
- deltaY = -i.containerHeight;
682
- } else {
683
- deltaY = -30;
684
- }
685
- break;
686
- case 32: // space bar
687
- if (e.shiftKey) {
688
- deltaY = i.containerHeight;
689
- } else {
690
- deltaY = -i.containerHeight;
691
- }
692
- break;
693
- case 33: // page up
694
- deltaY = i.containerHeight;
695
- break;
696
- case 34: // page down
697
- deltaY = -i.containerHeight;
698
- break;
699
- case 36: // home
700
- deltaY = i.contentHeight;
701
- break;
702
- case 35: // end
703
- deltaY = -i.contentHeight;
704
- break;
705
- default:
706
- return;
707
- }
708
-
709
- if (i.settings.suppressScrollX && deltaX !== 0) {
710
- return;
711
- }
712
- if (i.settings.suppressScrollY && deltaY !== 0) {
713
- return;
714
- }
715
-
716
- element.scrollTop -= deltaY;
717
- element.scrollLeft += deltaX;
718
- updateGeometry(i);
719
-
720
- if (shouldPreventDefault(deltaX, deltaY)) {
721
- e.preventDefault();
722
- }
723
- });
724
- };
725
-
726
- var wheel = function(i) {
727
- var element = i.element;
728
-
729
- function shouldPreventDefault(deltaX, deltaY) {
730
- var roundedScrollTop = Math.floor(element.scrollTop);
731
- var isTop = element.scrollTop === 0;
732
- var isBottom =
733
- roundedScrollTop + element.offsetHeight === element.scrollHeight;
734
- var isLeft = element.scrollLeft === 0;
735
- var isRight =
736
- element.scrollLeft + element.offsetWidth === element.scrollWidth;
737
-
738
- var hitsBound;
739
-
740
- // pick axis with primary direction
741
- if (Math.abs(deltaY) > Math.abs(deltaX)) {
742
- hitsBound = isTop || isBottom;
743
- } else {
744
- hitsBound = isLeft || isRight;
745
- }
746
-
747
- return hitsBound ? !i.settings.wheelPropagation : true;
748
- }
749
-
750
- function getDeltaFromEvent(e) {
751
- var deltaX = e.deltaX;
752
- var deltaY = -1 * e.deltaY;
753
-
754
- if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
755
- // OS X Safari
756
- deltaX = -1 * e.wheelDeltaX / 6;
757
- deltaY = e.wheelDeltaY / 6;
758
- }
759
-
760
- if (e.deltaMode && e.deltaMode === 1) {
761
- // Firefox in deltaMode 1: Line scrolling
762
- deltaX *= 10;
763
- deltaY *= 10;
764
- }
765
-
766
- if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
767
- // IE in some mouse drivers
768
- deltaX = 0;
769
- deltaY = e.wheelDelta;
770
- }
771
-
772
- if (e.shiftKey) {
773
- // reverse axis with shift key
774
- return [-deltaY, -deltaX];
775
- }
776
- return [deltaX, deltaY];
777
- }
778
-
779
- function shouldBeConsumedByChild(target, deltaX, deltaY) {
780
- // FIXME: this is a workaround for <select> issue in FF and IE #571
781
- if (!env.isWebKit && element.querySelector('select:focus')) {
782
- return true;
783
- }
784
-
785
- if (!element.contains(target)) {
786
- return false;
787
- }
788
-
789
- var cursor = target;
790
-
791
- while (cursor && cursor !== element) {
792
- if (cursor.classList.contains(cls.element.consuming)) {
793
- return true;
794
- }
795
-
796
- var style = get(cursor);
797
- var overflow = [style.overflow, style.overflowX, style.overflowY].join(
798
- ''
799
- );
800
-
801
- // if scrollable
802
- if (overflow.match(/(scroll|auto)/)) {
803
- var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
804
- if (maxScrollTop > 0) {
805
- if (
806
- !(cursor.scrollTop === 0 && deltaY > 0) &&
807
- !(cursor.scrollTop === maxScrollTop && deltaY < 0)
808
- ) {
809
- return true;
810
- }
811
- }
812
- var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
813
- if (maxScrollLeft > 0) {
814
- if (
815
- !(cursor.scrollLeft === 0 && deltaX < 0) &&
816
- !(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
817
- ) {
818
- return true;
819
- }
820
- }
821
- }
822
-
823
- cursor = cursor.parentNode;
824
- }
825
-
826
- return false;
827
- }
828
-
829
- function mousewheelHandler(e) {
830
- var ref = getDeltaFromEvent(e);
831
- var deltaX = ref[0];
832
- var deltaY = ref[1];
833
-
834
- if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
835
- return;
836
- }
837
-
838
- var shouldPrevent = false;
839
- if (!i.settings.useBothWheelAxes) {
840
- // deltaX will only be used for horizontal scrolling and deltaY will
841
- // only be used for vertical scrolling - this is the default
842
- element.scrollTop -= deltaY * i.settings.wheelSpeed;
843
- element.scrollLeft += deltaX * i.settings.wheelSpeed;
844
- } else if (i.scrollbarYActive && !i.scrollbarXActive) {
845
- // only vertical scrollbar is active and useBothWheelAxes option is
846
- // active, so let's scroll vertical bar using both mouse wheel axes
847
- if (deltaY) {
848
- element.scrollTop -= deltaY * i.settings.wheelSpeed;
849
- } else {
850
- element.scrollTop += deltaX * i.settings.wheelSpeed;
851
- }
852
- shouldPrevent = true;
853
- } else if (i.scrollbarXActive && !i.scrollbarYActive) {
854
- // useBothWheelAxes and only horizontal bar is active, so use both
855
- // wheel axes for horizontal bar
856
- if (deltaX) {
857
- element.scrollLeft += deltaX * i.settings.wheelSpeed;
858
- } else {
859
- element.scrollLeft -= deltaY * i.settings.wheelSpeed;
860
- }
861
- shouldPrevent = true;
862
- }
863
-
864
- updateGeometry(i);
865
-
866
- shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
867
- if (shouldPrevent && !e.ctrlKey) {
868
- e.stopPropagation();
869
- e.preventDefault();
870
- }
871
- }
872
-
873
- if (typeof window.onwheel !== 'undefined') {
874
- i.event.bind(element, 'wheel', mousewheelHandler);
875
- } else if (typeof window.onmousewheel !== 'undefined') {
876
- i.event.bind(element, 'mousewheel', mousewheelHandler);
877
- }
878
- };
879
-
880
- var touch = function(i) {
881
- if (!env.supportsTouch && !env.supportsIePointer) {
882
- return;
883
- }
884
-
885
- var element = i.element;
886
-
887
- function shouldPrevent(deltaX, deltaY) {
888
- var scrollTop = Math.floor(element.scrollTop);
889
- var scrollLeft = element.scrollLeft;
890
- var magnitudeX = Math.abs(deltaX);
891
- var magnitudeY = Math.abs(deltaY);
892
-
893
- if (magnitudeY > magnitudeX) {
894
- // user is perhaps trying to swipe up/down the page
895
-
896
- if (
897
- (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
898
- (deltaY > 0 && scrollTop === 0)
899
- ) {
900
- // set prevent for mobile Chrome refresh
901
- return window.scrollY === 0 && deltaY > 0 && env.isChrome;
902
- }
903
- } else if (magnitudeX > magnitudeY) {
904
- // user is perhaps trying to swipe left/right across the page
905
-
906
- if (
907
- (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
908
- (deltaX > 0 && scrollLeft === 0)
909
- ) {
910
- return true;
911
- }
912
- }
913
-
914
- return true;
915
- }
916
-
917
- function applyTouchMove(differenceX, differenceY) {
918
- element.scrollTop -= differenceY;
919
- element.scrollLeft -= differenceX;
920
-
921
- updateGeometry(i);
922
- }
923
-
924
- var startOffset = {};
925
- var startTime = 0;
926
- var speed = {};
927
- var easingLoop = null;
928
-
929
- function getTouch(e) {
930
- if (e.targetTouches) {
931
- return e.targetTouches[0];
932
- } else {
933
- // Maybe IE pointer
934
- return e;
935
- }
936
- }
937
-
938
- function shouldHandle(e) {
939
- if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
940
- return false;
941
- }
942
- if (e.targetTouches && e.targetTouches.length === 1) {
943
- return true;
944
- }
945
- if (
946
- e.pointerType &&
947
- e.pointerType !== 'mouse' &&
948
- e.pointerType !== e.MSPOINTER_TYPE_MOUSE
949
- ) {
950
- return true;
951
- }
952
- return false;
953
- }
954
-
955
- function touchStart(e) {
956
- if (!shouldHandle(e)) {
957
- return;
958
- }
959
-
960
- var touch = getTouch(e);
961
-
962
- startOffset.pageX = touch.pageX;
963
- startOffset.pageY = touch.pageY;
964
-
965
- startTime = new Date().getTime();
966
-
967
- if (easingLoop !== null) {
968
- clearInterval(easingLoop);
969
- }
970
- }
971
-
972
- function shouldBeConsumedByChild(target, deltaX, deltaY) {
973
- if (!element.contains(target)) {
974
- return false;
975
- }
976
-
977
- var cursor = target;
978
-
979
- while (cursor && cursor !== element) {
980
- if (cursor.classList.contains(cls.element.consuming)) {
981
- return true;
982
- }
983
-
984
- var style = get(cursor);
985
- var overflow = [style.overflow, style.overflowX, style.overflowY].join(
986
- ''
987
- );
988
-
989
- // if scrollable
990
- if (overflow.match(/(scroll|auto)/)) {
991
- var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
992
- if (maxScrollTop > 0) {
993
- if (
994
- !(cursor.scrollTop === 0 && deltaY > 0) &&
995
- !(cursor.scrollTop === maxScrollTop && deltaY < 0)
996
- ) {
997
- return true;
998
- }
999
- }
1000
- var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth;
1001
- if (maxScrollLeft > 0) {
1002
- if (
1003
- !(cursor.scrollLeft === 0 && deltaX < 0) &&
1004
- !(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
1005
- ) {
1006
- return true;
1007
- }
1008
- }
1009
- }
1010
-
1011
- cursor = cursor.parentNode;
1012
- }
1013
-
1014
- return false;
1015
- }
1016
-
1017
- function touchMove(e) {
1018
- if (shouldHandle(e)) {
1019
- var touch = getTouch(e);
1020
-
1021
- var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
1022
-
1023
- var differenceX = currentOffset.pageX - startOffset.pageX;
1024
- var differenceY = currentOffset.pageY - startOffset.pageY;
1025
-
1026
- if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
1027
- return;
1028
- }
1029
-
1030
- applyTouchMove(differenceX, differenceY);
1031
- startOffset = currentOffset;
1032
-
1033
- var currentTime = new Date().getTime();
1034
-
1035
- var timeGap = currentTime - startTime;
1036
- if (timeGap > 0) {
1037
- speed.x = differenceX / timeGap;
1038
- speed.y = differenceY / timeGap;
1039
- startTime = currentTime;
1040
- }
1041
-
1042
- if (shouldPrevent(differenceX, differenceY)) {
1043
- e.preventDefault();
1044
- }
1045
- }
1046
- }
1047
- function touchEnd() {
1048
- if (i.settings.swipeEasing) {
1049
- clearInterval(easingLoop);
1050
- easingLoop = setInterval(function() {
1051
- if (i.isInitialized) {
1052
- clearInterval(easingLoop);
1053
- return;
1054
- }
1055
-
1056
- if (!speed.x && !speed.y) {
1057
- clearInterval(easingLoop);
1058
- return;
1059
- }
1060
-
1061
- if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
1062
- clearInterval(easingLoop);
1063
- return;
1064
- }
1065
-
1066
- applyTouchMove(speed.x * 30, speed.y * 30);
1067
-
1068
- speed.x *= 0.8;
1069
- speed.y *= 0.8;
1070
- }, 10);
1071
- }
1072
- }
1073
-
1074
- if (env.supportsTouch) {
1075
- i.event.bind(element, 'touchstart', touchStart);
1076
- i.event.bind(element, 'touchmove', touchMove);
1077
- i.event.bind(element, 'touchend', touchEnd);
1078
- } else if (env.supportsIePointer) {
1079
- if (window.PointerEvent) {
1080
- i.event.bind(element, 'pointerdown', touchStart);
1081
- i.event.bind(element, 'pointermove', touchMove);
1082
- i.event.bind(element, 'pointerup', touchEnd);
1083
- } else if (window.MSPointerEvent) {
1084
- i.event.bind(element, 'MSPointerDown', touchStart);
1085
- i.event.bind(element, 'MSPointerMove', touchMove);
1086
- i.event.bind(element, 'MSPointerUp', touchEnd);
1087
- }
1088
- }
1089
- };
1090
-
1091
- var defaultSettings = function () { return ({
1092
- handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
1093
- maxScrollbarLength: null,
1094
- minScrollbarLength: null,
1095
- scrollingThreshold: 1000,
1096
- scrollXMarginOffset: 0,
1097
- scrollYMarginOffset: 0,
1098
- suppressScrollX: false,
1099
- suppressScrollY: false,
1100
- swipeEasing: true,
1101
- useBothWheelAxes: false,
1102
- wheelPropagation: true,
1103
- wheelSpeed: 1,
1104
- }); };
1105
-
1106
- var handlers = {
1107
- 'click-rail': clickRail,
1108
- 'drag-thumb': dragThumb,
1109
- keyboard: keyboard,
1110
- wheel: wheel,
1111
- touch: touch,
1112
- };
1113
-
1114
- var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
1115
- var this$1 = this;
1116
- if ( userSettings === void 0 ) userSettings = {};
1117
-
1118
- if (typeof element === 'string') {
1119
- element = document.querySelector(element);
1120
- }
1121
-
1122
- if (!element || !element.nodeName) {
1123
- throw new Error('no element is specified to initialize PerfectScrollbar');
1124
- }
1125
-
1126
- this.element = element;
1127
-
1128
- element.classList.add(cls.main);
1129
-
1130
- this.settings = defaultSettings();
1131
- for (var key in userSettings) {
1132
- this$1.settings[key] = userSettings[key];
1133
- }
1134
-
1135
- this.containerWidth = null;
1136
- this.containerHeight = null;
1137
- this.contentWidth = null;
1138
- this.contentHeight = null;
1139
-
1140
- var focus = function () { return element.classList.add(cls.state.focus); };
1141
- var blur = function () { return element.classList.remove(cls.state.focus); };
1142
-
1143
- this.isRtl = get(element).direction === 'rtl';
1144
- this.isNegativeScroll = (function () {
1145
- var originalScrollLeft = element.scrollLeft;
1146
- var result = null;
1147
- element.scrollLeft = -1;
1148
- result = element.scrollLeft < 0;
1149
- element.scrollLeft = originalScrollLeft;
1150
- return result;
1151
- })();
1152
- this.negativeScrollAdjustment = this.isNegativeScroll
1153
- ? element.scrollWidth - element.clientWidth
1154
- : 0;
1155
- this.event = new EventManager();
1156
- this.ownerDocument = element.ownerDocument || document;
1157
-
1158
- this.scrollbarXRail = div(cls.element.rail('x'));
1159
- element.appendChild(this.scrollbarXRail);
1160
- this.scrollbarX = div(cls.element.thumb('x'));
1161
- this.scrollbarXRail.appendChild(this.scrollbarX);
1162
- this.scrollbarX.setAttribute('tabindex', 0);
1163
- this.event.bind(this.scrollbarX, 'focus', focus);
1164
- this.event.bind(this.scrollbarX, 'blur', blur);
1165
- this.scrollbarXActive = null;
1166
- this.scrollbarXWidth = null;
1167
- this.scrollbarXLeft = null;
1168
- var railXStyle = get(this.scrollbarXRail);
1169
- this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
1170
- if (isNaN(this.scrollbarXBottom)) {
1171
- this.isScrollbarXUsingBottom = false;
1172
- this.scrollbarXTop = toInt(railXStyle.top);
1173
- } else {
1174
- this.isScrollbarXUsingBottom = true;
1175
- }
1176
- this.railBorderXWidth =
1177
- toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
1178
- // Set rail to display:block to calculate margins
1179
- set(this.scrollbarXRail, { display: 'block' });
1180
- this.railXMarginWidth =
1181
- toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
1182
- set(this.scrollbarXRail, { display: '' });
1183
- this.railXWidth = null;
1184
- this.railXRatio = null;
1185
-
1186
- this.scrollbarYRail = div(cls.element.rail('y'));
1187
- element.appendChild(this.scrollbarYRail);
1188
- this.scrollbarY = div(cls.element.thumb('y'));
1189
- this.scrollbarYRail.appendChild(this.scrollbarY);
1190
- this.scrollbarY.setAttribute('tabindex', 0);
1191
- this.event.bind(this.scrollbarY, 'focus', focus);
1192
- this.event.bind(this.scrollbarY, 'blur', blur);
1193
- this.scrollbarYActive = null;
1194
- this.scrollbarYHeight = null;
1195
- this.scrollbarYTop = null;
1196
- var railYStyle = get(this.scrollbarYRail);
1197
- this.scrollbarYRight = parseInt(railYStyle.right, 10);
1198
- if (isNaN(this.scrollbarYRight)) {
1199
- this.isScrollbarYUsingRight = false;
1200
- this.scrollbarYLeft = toInt(railYStyle.left);
1201
- } else {
1202
- this.isScrollbarYUsingRight = true;
1203
- }
1204
- this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
1205
- this.railBorderYWidth =
1206
- toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
1207
- set(this.scrollbarYRail, { display: 'block' });
1208
- this.railYMarginHeight =
1209
- toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
1210
- set(this.scrollbarYRail, { display: '' });
1211
- this.railYHeight = null;
1212
- this.railYRatio = null;
1213
-
1214
- this.reach = {
1215
- x:
1216
- element.scrollLeft <= 0
1217
- ? 'start'
1218
- : element.scrollLeft >= this.contentWidth - this.containerWidth
1219
- ? 'end'
1220
- : null,
1221
- y:
1222
- element.scrollTop <= 0
1223
- ? 'start'
1224
- : element.scrollTop >= this.contentHeight - this.containerHeight
1225
- ? 'end'
1226
- : null,
1227
- };
1228
-
1229
- this.isAlive = true;
1230
-
1231
- this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
1232
-
1233
- this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
1234
- this.lastScrollLeft = element.scrollLeft; // for onScroll only
1235
- this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
1236
- updateGeometry(this);
1237
- };
1238
-
1239
- PerfectScrollbar.prototype.update = function update () {
1240
- if (!this.isAlive) {
1241
- return;
1242
- }
1243
-
1244
- // Recalcuate negative scrollLeft adjustment
1245
- this.negativeScrollAdjustment = this.isNegativeScroll
1246
- ? this.element.scrollWidth - this.element.clientWidth
1247
- : 0;
1248
-
1249
- // Recalculate rail margins
1250
- set(this.scrollbarXRail, { display: 'block' });
1251
- set(this.scrollbarYRail, { display: 'block' });
1252
- this.railXMarginWidth =
1253
- toInt(get(this.scrollbarXRail).marginLeft) +
1254
- toInt(get(this.scrollbarXRail).marginRight);
1255
- this.railYMarginHeight =
1256
- toInt(get(this.scrollbarYRail).marginTop) +
1257
- toInt(get(this.scrollbarYRail).marginBottom);
1258
-
1259
- // Hide scrollbars not to affect scrollWidth and scrollHeight
1260
- set(this.scrollbarXRail, { display: 'none' });
1261
- set(this.scrollbarYRail, { display: 'none' });
1262
-
1263
- updateGeometry(this);
1264
-
1265
- processScrollDiff(this, 'top', 0, false, true);
1266
- processScrollDiff(this, 'left', 0, false, true);
1267
-
1268
- set(this.scrollbarXRail, { display: '' });
1269
- set(this.scrollbarYRail, { display: '' });
1270
- };
1271
-
1272
- PerfectScrollbar.prototype.onScroll = function onScroll (e) {
1273
- if (!this.isAlive) {
1274
- return;
1275
- }
1276
-
1277
- updateGeometry(this);
1278
- processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
1279
- processScrollDiff(
1280
- this,
1281
- 'left',
1282
- this.element.scrollLeft - this.lastScrollLeft
1283
- );
1284
-
1285
- this.lastScrollTop = Math.floor(this.element.scrollTop);
1286
- this.lastScrollLeft = this.element.scrollLeft;
1287
- };
1288
-
1289
- PerfectScrollbar.prototype.destroy = function destroy () {
1290
- if (!this.isAlive) {
1291
- return;
1292
- }
1293
-
1294
- this.event.unbindAll();
1295
- remove(this.scrollbarX);
1296
- remove(this.scrollbarY);
1297
- remove(this.scrollbarXRail);
1298
- remove(this.scrollbarYRail);
1299
- this.removePsClasses();
1300
-
1301
- // unset elements
1302
- this.element = null;
1303
- this.scrollbarX = null;
1304
- this.scrollbarY = null;
1305
- this.scrollbarXRail = null;
1306
- this.scrollbarYRail = null;
1307
-
1308
- this.isAlive = false;
1309
- };
1310
-
1311
- PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
1312
- this.element.className = this.element.className
1313
- .split(' ')
1314
- .filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
1315
- .join(' ');
1316
- };
1317
-
1318
- module.exports = PerfectScrollbar;
1
+ /*!
2
+ * perfect-scrollbar v1.4.0
3
+ * (c) 2018 Hyunje Jun
4
+ * @license MIT
5
+ */
6
+ 'use strict';
7
+
8
+ function get(element) {
9
+ return getComputedStyle(element);
10
+ }
11
+
12
+ function set(element, obj) {
13
+ for (var key in obj) {
14
+ var val = obj[key];
15
+ if (typeof val === 'number') {
16
+ val = val + "px";
17
+ }
18
+ element.style[key] = val;
19
+ }
20
+ return element;
21
+ }
22
+
23
+ function div(className) {
24
+ var div = document.createElement('div');
25
+ div.className = className;
26
+ return div;
27
+ }
28
+
29
+ var elMatches =
30
+ typeof Element !== 'undefined' &&
31
+ (Element.prototype.matches ||
32
+ Element.prototype.webkitMatchesSelector ||
33
+ Element.prototype.mozMatchesSelector ||
34
+ Element.prototype.msMatchesSelector);
35
+
36
+ function matches(element, query) {
37
+ if (!elMatches) {
38
+ throw new Error('No element matching method supported');
39
+ }
40
+
41
+ return elMatches.call(element, query);
42
+ }
43
+
44
+ function remove(element) {
45
+ if (element.remove) {
46
+ element.remove();
47
+ } else {
48
+ if (element.parentNode) {
49
+ element.parentNode.removeChild(element);
50
+ }
51
+ }
52
+ }
53
+
54
+ function queryChildren(element, selector) {
55
+ return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
56
+ );
57
+ }
58
+
59
+ var cls = {
60
+ main: 'ps',
61
+ element: {
62
+ thumb: function (x) { return ("ps__thumb-" + x); },
63
+ rail: function (x) { return ("ps__rail-" + x); },
64
+ consuming: 'ps__child--consume',
65
+ },
66
+ state: {
67
+ focus: 'ps--focus',
68
+ clicking: 'ps--clicking',
69
+ active: function (x) { return ("ps--active-" + x); },
70
+ scrolling: function (x) { return ("ps--scrolling-" + x); },
71
+ },
72
+ };
73
+
74
+ /*
75
+ * Helper methods
76
+ */
77
+ var scrollingClassTimeout = { x: null, y: null };
78
+
79
+ function addScrollingClass(i, x) {
80
+ var classList = i.element.classList;
81
+ var className = cls.state.scrolling(x);
82
+
83
+ if (classList.contains(className)) {
84
+ clearTimeout(scrollingClassTimeout[x]);
85
+ } else {
86
+ classList.add(className);
87
+ }
88
+ }
89
+
90
+ function removeScrollingClass(i, x) {
91
+ scrollingClassTimeout[x] = setTimeout(
92
+ function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
93
+ i.settings.scrollingThreshold
94
+ );
95
+ }
96
+
97
+ function setScrollingClassInstantly(i, x) {
98
+ addScrollingClass(i, x);
99
+ removeScrollingClass(i, x);
100
+ }
101
+
102
+ var EventElement = function EventElement(element) {
103
+ this.element = element;
104
+ this.handlers = {};
105
+ };
106
+
107
+ var prototypeAccessors = { isEmpty: { configurable: true } };
108
+
109
+ EventElement.prototype.bind = function bind (eventName, handler) {
110
+ if (typeof this.handlers[eventName] === 'undefined') {
111
+ this.handlers[eventName] = [];
112
+ }
113
+ this.handlers[eventName].push(handler);
114
+ this.element.addEventListener(eventName, handler, false);
115
+ };
116
+
117
+ EventElement.prototype.unbind = function unbind (eventName, target) {
118
+ var this$1 = this;
119
+
120
+ this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
121
+ if (target && handler !== target) {
122
+ return true;
123
+ }
124
+ this$1.element.removeEventListener(eventName, handler, false);
125
+ return false;
126
+ });
127
+ };
128
+
129
+ EventElement.prototype.unbindAll = function unbindAll () {
130
+ var this$1 = this;
131
+
132
+ for (var name in this$1.handlers) {
133
+ this$1.unbind(name);
134
+ }
135
+ };
136
+
137
+ prototypeAccessors.isEmpty.get = function () {
138
+ var this$1 = this;
139
+
140
+ return Object.keys(this.handlers).every(
141
+ function (key) { return this$1.handlers[key].length === 0; }
142
+ );
143
+ };
144
+
145
+ Object.defineProperties( EventElement.prototype, prototypeAccessors );
146
+
147
+ var EventManager = function EventManager() {
148
+ this.eventElements = [];
149
+ };
150
+
151
+ EventManager.prototype.eventElement = function eventElement (element) {
152
+ var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
153
+ if (!ee) {
154
+ ee = new EventElement(element);
155
+ this.eventElements.push(ee);
156
+ }
157
+ return ee;
158
+ };
159
+
160
+ EventManager.prototype.bind = function bind (element, eventName, handler) {
161
+ this.eventElement(element).bind(eventName, handler);
162
+ };
163
+
164
+ EventManager.prototype.unbind = function unbind (element, eventName, handler) {
165
+ var ee = this.eventElement(element);
166
+ ee.unbind(eventName, handler);
167
+
168
+ if (ee.isEmpty) {
169
+ // remove
170
+ this.eventElements.splice(this.eventElements.indexOf(ee), 1);
171
+ }
172
+ };
173
+
174
+ EventManager.prototype.unbindAll = function unbindAll () {
175
+ this.eventElements.forEach(function (e) { return e.unbindAll(); });
176
+ this.eventElements = [];
177
+ };
178
+
179
+ EventManager.prototype.once = function once (element, eventName, handler) {
180
+ var ee = this.eventElement(element);
181
+ var onceHandler = function (evt) {
182
+ ee.unbind(eventName, onceHandler);
183
+ handler(evt);
184
+ };
185
+ ee.bind(eventName, onceHandler);
186
+ };
187
+
188
+ function createEvent(name) {
189
+ if (typeof window.CustomEvent === 'function') {
190
+ return new CustomEvent(name);
191
+ } else {
192
+ var evt = document.createEvent('CustomEvent');
193
+ evt.initCustomEvent(name, false, false, undefined);
194
+ return evt;
195
+ }
196
+ }
197
+
198
+ var processScrollDiff = function(
199
+ i,
200
+ axis,
201
+ diff,
202
+ useScrollingClass,
203
+ forceFireReachEvent
204
+ ) {
205
+ if ( useScrollingClass === void 0 ) useScrollingClass = true;
206
+ if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
207
+
208
+ var fields;
209
+ if (axis === 'top') {
210
+ fields = [
211
+ 'contentHeight',
212
+ 'containerHeight',
213
+ 'scrollTop',
214
+ 'y',
215
+ 'up',
216
+ 'down' ];
217
+ } else if (axis === 'left') {
218
+ fields = [
219
+ 'contentWidth',
220
+ 'containerWidth',
221
+ 'scrollLeft',
222
+ 'x',
223
+ 'left',
224
+ 'right' ];
225
+ } else {
226
+ throw new Error('A proper axis should be provided');
227
+ }
228
+
229
+ processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
230
+ };
231
+
232
+ function processScrollDiff$1(
233
+ i,
234
+ diff,
235
+ ref,
236
+ useScrollingClass,
237
+ forceFireReachEvent
238
+ ) {
239
+ var contentHeight = ref[0];
240
+ var containerHeight = ref[1];
241
+ var scrollTop = ref[2];
242
+ var y = ref[3];
243
+ var up = ref[4];
244
+ var down = ref[5];
245
+ if ( useScrollingClass === void 0 ) useScrollingClass = true;
246
+ if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
247
+
248
+ var element = i.element;
249
+
250
+ // reset reach
251
+ i.reach[y] = null;
252
+
253
+ // 1 for subpixel rounding
254
+ if (element[scrollTop] < 1) {
255
+ i.reach[y] = 'start';
256
+ }
257
+
258
+ // 1 for subpixel rounding
259
+ if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
260
+ i.reach[y] = 'end';
261
+ }
262
+
263
+ if (diff) {
264
+ element.dispatchEvent(createEvent(("ps-scroll-" + y)));
265
+
266
+ if (diff < 0) {
267
+ element.dispatchEvent(createEvent(("ps-scroll-" + up)));
268
+ } else if (diff > 0) {
269
+ element.dispatchEvent(createEvent(("ps-scroll-" + down)));
270
+ }
271
+
272
+ if (useScrollingClass) {
273
+ setScrollingClassInstantly(i, y);
274
+ }
275
+ }
276
+
277
+ if (i.reach[y] && (diff || forceFireReachEvent)) {
278
+ element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
279
+ }
280
+ }
281
+
282
+ function toInt(x) {
283
+ return parseInt(x, 10) || 0;
284
+ }
285
+
286
+ function isEditable(el) {
287
+ return (
288
+ matches(el, 'input,[contenteditable]') ||
289
+ matches(el, 'select,[contenteditable]') ||
290
+ matches(el, 'textarea,[contenteditable]') ||
291
+ matches(el, 'button,[contenteditable]')
292
+ );
293
+ }
294
+
295
+ function outerWidth(element) {
296
+ var styles = get(element);
297
+ return (
298
+ toInt(styles.width) +
299
+ toInt(styles.paddingLeft) +
300
+ toInt(styles.paddingRight) +
301
+ toInt(styles.borderLeftWidth) +
302
+ toInt(styles.borderRightWidth)
303
+ );
304
+ }
305
+
306
+ var env = {
307
+ isWebKit:
308
+ typeof document !== 'undefined' &&
309
+ 'WebkitAppearance' in document.documentElement.style,
310
+ supportsTouch:
311
+ typeof window !== 'undefined' &&
312
+ ('ontouchstart' in window ||
313
+ (window.DocumentTouch && document instanceof window.DocumentTouch)),
314
+ supportsIePointer:
315
+ typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
316
+ isChrome:
317
+ typeof navigator !== 'undefined' &&
318
+ /Chrome/i.test(navigator && navigator.userAgent),
319
+ };
320
+
321
+ var updateGeometry = function(i) {
322
+ var element = i.element;
323
+ var roundedScrollTop = Math.floor(element.scrollTop);
324
+
325
+ i.containerWidth = element.clientWidth;
326
+ i.containerHeight = element.clientHeight;
327
+ i.contentWidth = element.scrollWidth;
328
+ i.contentHeight = element.scrollHeight;
329
+
330
+ if (!element.contains(i.scrollbarXRail)) {
331
+ // clean up and append
332
+ queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
333
+ );
334
+ element.appendChild(i.scrollbarXRail);
335
+ }
336
+ if (!element.contains(i.scrollbarYRail)) {
337
+ // clean up and append
338
+ queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
339
+ );
340
+ element.appendChild(i.scrollbarYRail);
341
+ }
342
+
343
+ if (
344
+ !i.settings.suppressScrollX &&
345
+ i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
346
+ ) {
347
+ i.scrollbarXActive = true;
348
+ i.railXWidth = i.containerWidth - i.railXMarginWidth;
349
+ i.railXRatio = i.containerWidth / i.railXWidth;
350
+ i.scrollbarXWidth = getThumbSize(
351
+ i,
352
+ toInt(i.railXWidth * i.containerWidth / i.contentWidth)
353
+ );
354
+ i.scrollbarXLeft = toInt(
355
+ (i.negativeScrollAdjustment + element.scrollLeft) *
356
+ (i.railXWidth - i.scrollbarXWidth) /
357
+ (i.contentWidth - i.containerWidth)
358
+ );
359
+ } else {
360
+ i.scrollbarXActive = false;
361
+ }
362
+
363
+ if (
364
+ !i.settings.suppressScrollY &&
365
+ i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
366
+ ) {
367
+ i.scrollbarYActive = true;
368
+ i.railYHeight = i.containerHeight - i.railYMarginHeight;
369
+ i.railYRatio = i.containerHeight / i.railYHeight;
370
+ i.scrollbarYHeight = getThumbSize(
371
+ i,
372
+ toInt(i.railYHeight * i.containerHeight / i.contentHeight)
373
+ );
374
+ i.scrollbarYTop = toInt(
375
+ roundedScrollTop *
376
+ (i.railYHeight - i.scrollbarYHeight) /
377
+ (i.contentHeight - i.containerHeight)
378
+ );
379
+ } else {
380
+ i.scrollbarYActive = false;
381
+ }
382
+
383
+ if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
384
+ i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
385
+ }
386
+ if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
387
+ i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
388
+ }
389
+
390
+ updateCss(element, i);
391
+
392
+ if (i.scrollbarXActive) {
393
+ element.classList.add(cls.state.active('x'));
394
+ } else {
395
+ element.classList.remove(cls.state.active('x'));
396
+ i.scrollbarXWidth = 0;
397
+ i.scrollbarXLeft = 0;
398
+ element.scrollLeft = 0;
399
+ }
400
+ if (i.scrollbarYActive) {
401
+ element.classList.add(cls.state.active('y'));
402
+ } else {
403
+ element.classList.remove(cls.state.active('y'));
404
+ i.scrollbarYHeight = 0;
405
+ i.scrollbarYTop = 0;
406
+ element.scrollTop = 0;
407
+ }
408
+ };
409
+
410
+ function getThumbSize(i, thumbSize) {
411
+ if (i.settings.minScrollbarLength) {
412
+ thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
413
+ }
414
+ if (i.settings.maxScrollbarLength) {
415
+ thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
416
+ }
417
+ return thumbSize;
418
+ }
419
+
420
+ function updateCss(element, i) {
421
+ var xRailOffset = { width: i.railXWidth };
422
+ var roundedScrollTop = Math.floor(element.scrollTop);
423
+
424
+ if (i.isRtl) {
425
+ xRailOffset.left =
426
+ i.negativeScrollAdjustment +
427
+ element.scrollLeft +
428
+ i.containerWidth -
429
+ i.contentWidth;
430
+ } else {
431
+ xRailOffset.left = element.scrollLeft;
432
+ }
433
+ if (i.isScrollbarXUsingBottom) {
434
+ xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
435
+ } else {
436
+ xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
437
+ }
438
+ set(i.scrollbarXRail, xRailOffset);
439
+
440
+ var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
441
+ if (i.isScrollbarYUsingRight) {
442
+ if (i.isRtl) {
443
+ yRailOffset.right =
444
+ i.contentWidth -
445
+ (i.negativeScrollAdjustment + element.scrollLeft) -
446
+ i.scrollbarYRight -
447
+ i.scrollbarYOuterWidth;
448
+ } else {
449
+ yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
450
+ }
451
+ } else {
452
+ if (i.isRtl) {
453
+ yRailOffset.left =
454
+ i.negativeScrollAdjustment +
455
+ element.scrollLeft +
456
+ i.containerWidth * 2 -
457
+ i.contentWidth -
458
+ i.scrollbarYLeft -
459
+ i.scrollbarYOuterWidth;
460
+ } else {
461
+ yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
462
+ }
463
+ }
464
+ set(i.scrollbarYRail, yRailOffset);
465
+
466
+ set(i.scrollbarX, {
467
+ left: i.scrollbarXLeft,
468
+ width: i.scrollbarXWidth - i.railBorderXWidth,
469
+ });
470
+ set(i.scrollbarY, {
471
+ top: i.scrollbarYTop,
472
+ height: i.scrollbarYHeight - i.railBorderYWidth,
473
+ });
474
+ }
475
+
476
+ var clickRail = function(i) {
477
+ i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
478
+ i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
479
+ var positionTop =
480
+ e.pageY -
481
+ window.pageYOffset -
482
+ i.scrollbarYRail.getBoundingClientRect().top;
483
+ var direction = positionTop > i.scrollbarYTop ? 1 : -1;
484
+
485
+ i.element.scrollTop += direction * i.containerHeight;
486
+ updateGeometry(i);
487
+
488
+ e.stopPropagation();
489
+ });
490
+
491
+ i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
492
+ i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
493
+ var positionLeft =
494
+ e.pageX -
495
+ window.pageXOffset -
496
+ i.scrollbarXRail.getBoundingClientRect().left;
497
+ var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
498
+
499
+ i.element.scrollLeft += direction * i.containerWidth;
500
+ updateGeometry(i);
501
+
502
+ e.stopPropagation();
503
+ });
504
+ };
505
+
506
+ var dragThumb = function(i) {
507
+ bindMouseScrollHandler(i, [
508
+ 'containerWidth',
509
+ 'contentWidth',
510
+ 'pageX',
511
+ 'railXWidth',
512
+ 'scrollbarX',
513
+ 'scrollbarXWidth',
514
+ 'scrollLeft',
515
+ 'x',
516
+ 'scrollbarXRail' ]);
517
+ bindMouseScrollHandler(i, [
518
+ 'containerHeight',
519
+ 'contentHeight',
520
+ 'pageY',
521
+ 'railYHeight',
522
+ 'scrollbarY',
523
+ 'scrollbarYHeight',
524
+ 'scrollTop',
525
+ 'y',
526
+ 'scrollbarYRail' ]);
527
+ };
528
+
529
+ function bindMouseScrollHandler(
530
+ i,
531
+ ref
532
+ ) {
533
+ var containerHeight = ref[0];
534
+ var contentHeight = ref[1];
535
+ var pageY = ref[2];
536
+ var railYHeight = ref[3];
537
+ var scrollbarY = ref[4];
538
+ var scrollbarYHeight = ref[5];
539
+ var scrollTop = ref[6];
540
+ var y = ref[7];
541
+ var scrollbarYRail = ref[8];
542
+
543
+ var element = i.element;
544
+
545
+ var startingScrollTop = null;
546
+ var startingMousePageY = null;
547
+ var scrollBy = null;
548
+
549
+ function mouseMoveHandler(e) {
550
+ element[scrollTop] =
551
+ startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
552
+ addScrollingClass(i, y);
553
+ updateGeometry(i);
554
+
555
+ e.stopPropagation();
556
+ e.preventDefault();
557
+ }
558
+
559
+ function mouseUpHandler() {
560
+ removeScrollingClass(i, y);
561
+ i[scrollbarYRail].classList.remove(cls.state.clicking);
562
+ i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
563
+ }
564
+
565
+ i.event.bind(i[scrollbarY], 'mousedown', function (e) {
566
+ startingScrollTop = element[scrollTop];
567
+ startingMousePageY = e[pageY];
568
+ scrollBy =
569
+ (i[contentHeight] - i[containerHeight]) /
570
+ (i[railYHeight] - i[scrollbarYHeight]);
571
+
572
+ i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
573
+ i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
574
+
575
+ i[scrollbarYRail].classList.add(cls.state.clicking);
576
+
577
+ e.stopPropagation();
578
+ e.preventDefault();
579
+ });
580
+ }
581
+
582
+ var keyboard = function(i) {
583
+ var element = i.element;
584
+
585
+ var elementHovered = function () { return matches(element, ':hover'); };
586
+ var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
587
+
588
+ function shouldPreventDefault(deltaX, deltaY) {
589
+ var scrollTop = Math.floor(element.scrollTop);
590
+ if (deltaX === 0) {
591
+ if (!i.scrollbarYActive) {
592
+ return false;
593
+ }
594
+ if (
595
+ (scrollTop === 0 && deltaY > 0) ||
596
+ (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
597
+ ) {
598
+ return !i.settings.wheelPropagation;
599
+ }
600
+ }
601
+
602
+ var scrollLeft = element.scrollLeft;
603
+ if (deltaY === 0) {
604
+ if (!i.scrollbarXActive) {
605
+ return false;
606
+ }
607
+ if (
608
+ (scrollLeft === 0 && deltaX < 0) ||
609
+ (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
610
+ ) {
611
+ return !i.settings.wheelPropagation;
612
+ }
613
+ }
614
+ return true;
615
+ }
616
+
617
+ i.event.bind(i.ownerDocument, 'keydown', function (e) {
618
+ if (
619
+ (e.isDefaultPrevented && e.isDefaultPrevented()) ||
620
+ e.defaultPrevented
621
+ ) {
622
+ return;
623
+ }
624
+
625
+ if (!elementHovered() && !scrollbarFocused()) {
626
+ return;
627
+ }
628
+
629
+ var activeElement = document.activeElement
630
+ ? document.activeElement
631
+ : i.ownerDocument.activeElement;
632
+ if (activeElement) {
633
+ if (activeElement.tagName === 'IFRAME') {
634
+ activeElement = activeElement.contentDocument.activeElement;
635
+ } else {
636
+ // go deeper if element is a webcomponent
637
+ while (activeElement.shadowRoot) {
638
+ activeElement = activeElement.shadowRoot.activeElement;
639
+ }
640
+ }
641
+ if (isEditable(activeElement)) {
642
+ return;
643
+ }
644
+ }
645
+
646
+ var deltaX = 0;
647
+ var deltaY = 0;
648
+
649
+ switch (e.which) {
650
+ case 37: // left
651
+ if (e.metaKey) {
652
+ deltaX = -i.contentWidth;
653
+ } else if (e.altKey) {
654
+ deltaX = -i.containerWidth;
655
+ } else {
656
+ deltaX = -30;
657
+ }
658
+ break;
659
+ case 38: // up
660
+ if (e.metaKey) {
661
+ deltaY = i.contentHeight;
662
+ } else if (e.altKey) {
663
+ deltaY = i.containerHeight;
664
+ } else {
665
+ deltaY = 30;
666
+ }
667
+ break;
668
+ case 39: // right
669
+ if (e.metaKey) {
670
+ deltaX = i.contentWidth;
671
+ } else if (e.altKey) {
672
+ deltaX = i.containerWidth;
673
+ } else {
674
+ deltaX = 30;
675
+ }
676
+ break;
677
+ case 40: // down
678
+ if (e.metaKey) {
679
+ deltaY = -i.contentHeight;
680
+ } else if (e.altKey) {
681
+ deltaY = -i.containerHeight;
682
+ } else {
683
+ deltaY = -30;
684
+ }
685
+ break;
686
+ case 32: // space bar
687
+ if (e.shiftKey) {
688
+ deltaY = i.containerHeight;
689
+ } else {
690
+ deltaY = -i.containerHeight;
691
+ }
692
+ break;
693
+ case 33: // page up
694
+ deltaY = i.containerHeight;
695
+ break;
696
+ case 34: // page down
697
+ deltaY = -i.containerHeight;
698
+ break;
699
+ case 36: // home
700
+ deltaY = i.contentHeight;
701
+ break;
702
+ case 35: // end
703
+ deltaY = -i.contentHeight;
704
+ break;
705
+ default:
706
+ return;
707
+ }
708
+
709
+ if (i.settings.suppressScrollX && deltaX !== 0) {
710
+ return;
711
+ }
712
+ if (i.settings.suppressScrollY && deltaY !== 0) {
713
+ return;
714
+ }
715
+
716
+ element.scrollTop -= deltaY;
717
+ element.scrollLeft += deltaX;
718
+ updateGeometry(i);
719
+
720
+ if (shouldPreventDefault(deltaX, deltaY)) {
721
+ e.preventDefault();
722
+ }
723
+ });
724
+ };
725
+
726
+ var wheel = function(i) {
727
+ var element = i.element;
728
+
729
+ function shouldPreventDefault(deltaX, deltaY) {
730
+ var roundedScrollTop = Math.floor(element.scrollTop);
731
+ var isTop = element.scrollTop === 0;
732
+ var isBottom =
733
+ roundedScrollTop + element.offsetHeight === element.scrollHeight;
734
+ var isLeft = element.scrollLeft === 0;
735
+ var isRight =
736
+ element.scrollLeft + element.offsetWidth === element.scrollWidth;
737
+
738
+ var hitsBound;
739
+
740
+ // pick axis with primary direction
741
+ if (Math.abs(deltaY) > Math.abs(deltaX)) {
742
+ hitsBound = isTop || isBottom;
743
+ } else {
744
+ hitsBound = isLeft || isRight;
745
+ }
746
+
747
+ return hitsBound ? !i.settings.wheelPropagation : true;
748
+ }
749
+
750
+ function getDeltaFromEvent(e) {
751
+ var deltaX = e.deltaX;
752
+ var deltaY = -1 * e.deltaY;
753
+
754
+ if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
755
+ // OS X Safari
756
+ deltaX = -1 * e.wheelDeltaX / 6;
757
+ deltaY = e.wheelDeltaY / 6;
758
+ }
759
+
760
+ if (e.deltaMode && e.deltaMode === 1) {
761
+ // Firefox in deltaMode 1: Line scrolling
762
+ deltaX *= 10;
763
+ deltaY *= 10;
764
+ }
765
+
766
+ if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
767
+ // IE in some mouse drivers
768
+ deltaX = 0;
769
+ deltaY = e.wheelDelta;
770
+ }
771
+
772
+ if (e.shiftKey) {
773
+ // reverse axis with shift key
774
+ return [-deltaY, -deltaX];
775
+ }
776
+ return [deltaX, deltaY];
777
+ }
778
+
779
+ function shouldBeConsumedByChild(target, deltaX, deltaY) {
780
+ // FIXME: this is a workaround for <select> issue in FF and IE #571
781
+ if (!env.isWebKit && element.querySelector('select:focus')) {
782
+ return true;
783
+ }
784
+
785
+ if (!element.contains(target)) {
786
+ return false;
787
+ }
788
+
789
+ var cursor = target;
790
+
791
+ while (cursor && cursor !== element) {
792
+ if (cursor.classList.contains(cls.element.consuming)) {
793
+ return true;
794
+ }
795
+
796
+ var style = get(cursor);
797
+ var overflow = [style.overflow, style.overflowX, style.overflowY].join(
798
+ ''
799
+ );
800
+
801
+ // if scrollable
802
+ if (overflow.match(/(scroll|auto)/)) {
803
+ var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
804
+ if (maxScrollTop > 0) {
805
+ if (
806
+ !(cursor.scrollTop === 0 && deltaY > 0) &&
807
+ !(cursor.scrollTop === maxScrollTop && deltaY < 0)
808
+ ) {
809
+ return true;
810
+ }
811
+ }
812
+ var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
813
+ if (maxScrollLeft > 0) {
814
+ if (
815
+ !(cursor.scrollLeft === 0 && deltaX < 0) &&
816
+ !(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
817
+ ) {
818
+ return true;
819
+ }
820
+ }
821
+ }
822
+
823
+ cursor = cursor.parentNode;
824
+ }
825
+
826
+ return false;
827
+ }
828
+
829
+ function mousewheelHandler(e) {
830
+ var ref = getDeltaFromEvent(e);
831
+ var deltaX = ref[0];
832
+ var deltaY = ref[1];
833
+
834
+ if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
835
+ return;
836
+ }
837
+
838
+ var shouldPrevent = false;
839
+ if (!i.settings.useBothWheelAxes) {
840
+ // deltaX will only be used for horizontal scrolling and deltaY will
841
+ // only be used for vertical scrolling - this is the default
842
+ element.scrollTop -= deltaY * i.settings.wheelSpeed;
843
+ element.scrollLeft += deltaX * i.settings.wheelSpeed;
844
+ } else if (i.scrollbarYActive && !i.scrollbarXActive) {
845
+ // only vertical scrollbar is active and useBothWheelAxes option is
846
+ // active, so let's scroll vertical bar using both mouse wheel axes
847
+ if (deltaY) {
848
+ element.scrollTop -= deltaY * i.settings.wheelSpeed;
849
+ } else {
850
+ element.scrollTop += deltaX * i.settings.wheelSpeed;
851
+ }
852
+ shouldPrevent = true;
853
+ } else if (i.scrollbarXActive && !i.scrollbarYActive) {
854
+ // useBothWheelAxes and only horizontal bar is active, so use both
855
+ // wheel axes for horizontal bar
856
+ if (deltaX) {
857
+ element.scrollLeft += deltaX * i.settings.wheelSpeed;
858
+ } else {
859
+ element.scrollLeft -= deltaY * i.settings.wheelSpeed;
860
+ }
861
+ shouldPrevent = true;
862
+ }
863
+
864
+ updateGeometry(i);
865
+
866
+ shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
867
+ if (shouldPrevent && !e.ctrlKey) {
868
+ e.stopPropagation();
869
+ e.preventDefault();
870
+ }
871
+ }
872
+
873
+ if (typeof window.onwheel !== 'undefined') {
874
+ i.event.bind(element, 'wheel', mousewheelHandler);
875
+ } else if (typeof window.onmousewheel !== 'undefined') {
876
+ i.event.bind(element, 'mousewheel', mousewheelHandler);
877
+ }
878
+ };
879
+
880
+ var touch = function(i) {
881
+ if (!env.supportsTouch && !env.supportsIePointer) {
882
+ return;
883
+ }
884
+
885
+ var element = i.element;
886
+
887
+ function shouldPrevent(deltaX, deltaY) {
888
+ var scrollTop = Math.floor(element.scrollTop);
889
+ var scrollLeft = element.scrollLeft;
890
+ var magnitudeX = Math.abs(deltaX);
891
+ var magnitudeY = Math.abs(deltaY);
892
+
893
+ if (magnitudeY > magnitudeX) {
894
+ // user is perhaps trying to swipe up/down the page
895
+
896
+ if (
897
+ (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
898
+ (deltaY > 0 && scrollTop === 0)
899
+ ) {
900
+ // set prevent for mobile Chrome refresh
901
+ return window.scrollY === 0 && deltaY > 0 && env.isChrome;
902
+ }
903
+ } else if (magnitudeX > magnitudeY) {
904
+ // user is perhaps trying to swipe left/right across the page
905
+
906
+ if (
907
+ (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
908
+ (deltaX > 0 && scrollLeft === 0)
909
+ ) {
910
+ return true;
911
+ }
912
+ }
913
+
914
+ return true;
915
+ }
916
+
917
+ function applyTouchMove(differenceX, differenceY) {
918
+ element.scrollTop -= differenceY;
919
+ element.scrollLeft -= differenceX;
920
+
921
+ updateGeometry(i);
922
+ }
923
+
924
+ var startOffset = {};
925
+ var startTime = 0;
926
+ var speed = {};
927
+ var easingLoop = null;
928
+
929
+ function getTouch(e) {
930
+ if (e.targetTouches) {
931
+ return e.targetTouches[0];
932
+ } else {
933
+ // Maybe IE pointer
934
+ return e;
935
+ }
936
+ }
937
+
938
+ function shouldHandle(e) {
939
+ if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
940
+ return false;
941
+ }
942
+ if (e.targetTouches && e.targetTouches.length === 1) {
943
+ return true;
944
+ }
945
+ if (
946
+ e.pointerType &&
947
+ e.pointerType !== 'mouse' &&
948
+ e.pointerType !== e.MSPOINTER_TYPE_MOUSE
949
+ ) {
950
+ return true;
951
+ }
952
+ return false;
953
+ }
954
+
955
+ function touchStart(e) {
956
+ if (!shouldHandle(e)) {
957
+ return;
958
+ }
959
+
960
+ var touch = getTouch(e);
961
+
962
+ startOffset.pageX = touch.pageX;
963
+ startOffset.pageY = touch.pageY;
964
+
965
+ startTime = new Date().getTime();
966
+
967
+ if (easingLoop !== null) {
968
+ clearInterval(easingLoop);
969
+ }
970
+ }
971
+
972
+ function shouldBeConsumedByChild(target, deltaX, deltaY) {
973
+ if (!element.contains(target)) {
974
+ return false;
975
+ }
976
+
977
+ var cursor = target;
978
+
979
+ while (cursor && cursor !== element) {
980
+ if (cursor.classList.contains(cls.element.consuming)) {
981
+ return true;
982
+ }
983
+
984
+ var style = get(cursor);
985
+ var overflow = [style.overflow, style.overflowX, style.overflowY].join(
986
+ ''
987
+ );
988
+
989
+ // if scrollable
990
+ if (overflow.match(/(scroll|auto)/)) {
991
+ var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
992
+ if (maxScrollTop > 0) {
993
+ if (
994
+ !(cursor.scrollTop === 0 && deltaY > 0) &&
995
+ !(cursor.scrollTop === maxScrollTop && deltaY < 0)
996
+ ) {
997
+ return true;
998
+ }
999
+ }
1000
+ var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth;
1001
+ if (maxScrollLeft > 0) {
1002
+ if (
1003
+ !(cursor.scrollLeft === 0 && deltaX < 0) &&
1004
+ !(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
1005
+ ) {
1006
+ return true;
1007
+ }
1008
+ }
1009
+ }
1010
+
1011
+ cursor = cursor.parentNode;
1012
+ }
1013
+
1014
+ return false;
1015
+ }
1016
+
1017
+ function touchMove(e) {
1018
+ if (shouldHandle(e)) {
1019
+ var touch = getTouch(e);
1020
+
1021
+ var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
1022
+
1023
+ var differenceX = currentOffset.pageX - startOffset.pageX;
1024
+ var differenceY = currentOffset.pageY - startOffset.pageY;
1025
+
1026
+ if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
1027
+ return;
1028
+ }
1029
+
1030
+ applyTouchMove(differenceX, differenceY);
1031
+ startOffset = currentOffset;
1032
+
1033
+ var currentTime = new Date().getTime();
1034
+
1035
+ var timeGap = currentTime - startTime;
1036
+ if (timeGap > 0) {
1037
+ speed.x = differenceX / timeGap;
1038
+ speed.y = differenceY / timeGap;
1039
+ startTime = currentTime;
1040
+ }
1041
+
1042
+ if (shouldPrevent(differenceX, differenceY)) {
1043
+ e.preventDefault();
1044
+ }
1045
+ }
1046
+ }
1047
+ function touchEnd() {
1048
+ if (i.settings.swipeEasing) {
1049
+ clearInterval(easingLoop);
1050
+ easingLoop = setInterval(function() {
1051
+ if (i.isInitialized) {
1052
+ clearInterval(easingLoop);
1053
+ return;
1054
+ }
1055
+
1056
+ if (!speed.x && !speed.y) {
1057
+ clearInterval(easingLoop);
1058
+ return;
1059
+ }
1060
+
1061
+ if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
1062
+ clearInterval(easingLoop);
1063
+ return;
1064
+ }
1065
+
1066
+ applyTouchMove(speed.x * 30, speed.y * 30);
1067
+
1068
+ speed.x *= 0.8;
1069
+ speed.y *= 0.8;
1070
+ }, 10);
1071
+ }
1072
+ }
1073
+
1074
+ if (env.supportsTouch) {
1075
+ i.event.bind(element, 'touchstart', touchStart);
1076
+ i.event.bind(element, 'touchmove', touchMove);
1077
+ i.event.bind(element, 'touchend', touchEnd);
1078
+ } else if (env.supportsIePointer) {
1079
+ if (window.PointerEvent) {
1080
+ i.event.bind(element, 'pointerdown', touchStart);
1081
+ i.event.bind(element, 'pointermove', touchMove);
1082
+ i.event.bind(element, 'pointerup', touchEnd);
1083
+ } else if (window.MSPointerEvent) {
1084
+ i.event.bind(element, 'MSPointerDown', touchStart);
1085
+ i.event.bind(element, 'MSPointerMove', touchMove);
1086
+ i.event.bind(element, 'MSPointerUp', touchEnd);
1087
+ }
1088
+ }
1089
+ };
1090
+
1091
+ var defaultSettings = function () { return ({
1092
+ handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
1093
+ maxScrollbarLength: null,
1094
+ minScrollbarLength: null,
1095
+ scrollingThreshold: 1000,
1096
+ scrollXMarginOffset: 0,
1097
+ scrollYMarginOffset: 0,
1098
+ suppressScrollX: false,
1099
+ suppressScrollY: false,
1100
+ swipeEasing: true,
1101
+ useBothWheelAxes: false,
1102
+ wheelPropagation: true,
1103
+ wheelSpeed: 1,
1104
+ }); };
1105
+
1106
+ var handlers = {
1107
+ 'click-rail': clickRail,
1108
+ 'drag-thumb': dragThumb,
1109
+ keyboard: keyboard,
1110
+ wheel: wheel,
1111
+ touch: touch,
1112
+ };
1113
+
1114
+ var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
1115
+ var this$1 = this;
1116
+ if ( userSettings === void 0 ) userSettings = {};
1117
+
1118
+ if (typeof element === 'string') {
1119
+ element = document.querySelector(element);
1120
+ }
1121
+
1122
+ if (!element || !element.nodeName) {
1123
+ throw new Error('no element is specified to initialize PerfectScrollbar');
1124
+ }
1125
+
1126
+ this.element = element;
1127
+
1128
+ element.classList.add(cls.main);
1129
+
1130
+ this.settings = defaultSettings();
1131
+ for (var key in userSettings) {
1132
+ this$1.settings[key] = userSettings[key];
1133
+ }
1134
+
1135
+ this.containerWidth = null;
1136
+ this.containerHeight = null;
1137
+ this.contentWidth = null;
1138
+ this.contentHeight = null;
1139
+
1140
+ var focus = function () { return element.classList.add(cls.state.focus); };
1141
+ var blur = function () { return element.classList.remove(cls.state.focus); };
1142
+
1143
+ this.isRtl = get(element).direction === 'rtl';
1144
+ this.isNegativeScroll = (function () {
1145
+ var originalScrollLeft = element.scrollLeft;
1146
+ var result = null;
1147
+ element.scrollLeft = -1;
1148
+ result = element.scrollLeft < 0;
1149
+ element.scrollLeft = originalScrollLeft;
1150
+ return result;
1151
+ })();
1152
+ this.negativeScrollAdjustment = this.isNegativeScroll
1153
+ ? element.scrollWidth - element.clientWidth
1154
+ : 0;
1155
+ this.event = new EventManager();
1156
+ this.ownerDocument = element.ownerDocument || document;
1157
+
1158
+ this.scrollbarXRail = div(cls.element.rail('x'));
1159
+ element.appendChild(this.scrollbarXRail);
1160
+ this.scrollbarX = div(cls.element.thumb('x'));
1161
+ this.scrollbarXRail.appendChild(this.scrollbarX);
1162
+ this.scrollbarX.setAttribute('tabindex', 0);
1163
+ this.event.bind(this.scrollbarX, 'focus', focus);
1164
+ this.event.bind(this.scrollbarX, 'blur', blur);
1165
+ this.scrollbarXActive = null;
1166
+ this.scrollbarXWidth = null;
1167
+ this.scrollbarXLeft = null;
1168
+ var railXStyle = get(this.scrollbarXRail);
1169
+ this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
1170
+ if (isNaN(this.scrollbarXBottom)) {
1171
+ this.isScrollbarXUsingBottom = false;
1172
+ this.scrollbarXTop = toInt(railXStyle.top);
1173
+ } else {
1174
+ this.isScrollbarXUsingBottom = true;
1175
+ }
1176
+ this.railBorderXWidth =
1177
+ toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
1178
+ // Set rail to display:block to calculate margins
1179
+ set(this.scrollbarXRail, { display: 'block' });
1180
+ this.railXMarginWidth =
1181
+ toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
1182
+ set(this.scrollbarXRail, { display: '' });
1183
+ this.railXWidth = null;
1184
+ this.railXRatio = null;
1185
+
1186
+ this.scrollbarYRail = div(cls.element.rail('y'));
1187
+ element.appendChild(this.scrollbarYRail);
1188
+ this.scrollbarY = div(cls.element.thumb('y'));
1189
+ this.scrollbarYRail.appendChild(this.scrollbarY);
1190
+ this.scrollbarY.setAttribute('tabindex', 0);
1191
+ this.event.bind(this.scrollbarY, 'focus', focus);
1192
+ this.event.bind(this.scrollbarY, 'blur', blur);
1193
+ this.scrollbarYActive = null;
1194
+ this.scrollbarYHeight = null;
1195
+ this.scrollbarYTop = null;
1196
+ var railYStyle = get(this.scrollbarYRail);
1197
+ this.scrollbarYRight = parseInt(railYStyle.right, 10);
1198
+ if (isNaN(this.scrollbarYRight)) {
1199
+ this.isScrollbarYUsingRight = false;
1200
+ this.scrollbarYLeft = toInt(railYStyle.left);
1201
+ } else {
1202
+ this.isScrollbarYUsingRight = true;
1203
+ }
1204
+ this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
1205
+ this.railBorderYWidth =
1206
+ toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
1207
+ set(this.scrollbarYRail, { display: 'block' });
1208
+ this.railYMarginHeight =
1209
+ toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
1210
+ set(this.scrollbarYRail, { display: '' });
1211
+ this.railYHeight = null;
1212
+ this.railYRatio = null;
1213
+
1214
+ this.reach = {
1215
+ x:
1216
+ element.scrollLeft <= 0
1217
+ ? 'start'
1218
+ : element.scrollLeft >= this.contentWidth - this.containerWidth
1219
+ ? 'end'
1220
+ : null,
1221
+ y:
1222
+ element.scrollTop <= 0
1223
+ ? 'start'
1224
+ : element.scrollTop >= this.contentHeight - this.containerHeight
1225
+ ? 'end'
1226
+ : null,
1227
+ };
1228
+
1229
+ this.isAlive = true;
1230
+
1231
+ this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
1232
+
1233
+ this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
1234
+ this.lastScrollLeft = element.scrollLeft; // for onScroll only
1235
+ this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
1236
+ updateGeometry(this);
1237
+ };
1238
+
1239
+ PerfectScrollbar.prototype.update = function update () {
1240
+ if (!this.isAlive) {
1241
+ return;
1242
+ }
1243
+
1244
+ // Recalcuate negative scrollLeft adjustment
1245
+ this.negativeScrollAdjustment = this.isNegativeScroll
1246
+ ? this.element.scrollWidth - this.element.clientWidth
1247
+ : 0;
1248
+
1249
+ // Recalculate rail margins
1250
+ set(this.scrollbarXRail, { display: 'block' });
1251
+ set(this.scrollbarYRail, { display: 'block' });
1252
+ this.railXMarginWidth =
1253
+ toInt(get(this.scrollbarXRail).marginLeft) +
1254
+ toInt(get(this.scrollbarXRail).marginRight);
1255
+ this.railYMarginHeight =
1256
+ toInt(get(this.scrollbarYRail).marginTop) +
1257
+ toInt(get(this.scrollbarYRail).marginBottom);
1258
+
1259
+ // Hide scrollbars not to affect scrollWidth and scrollHeight
1260
+ set(this.scrollbarXRail, { display: 'none' });
1261
+ set(this.scrollbarYRail, { display: 'none' });
1262
+
1263
+ updateGeometry(this);
1264
+
1265
+ processScrollDiff(this, 'top', 0, false, true);
1266
+ processScrollDiff(this, 'left', 0, false, true);
1267
+
1268
+ set(this.scrollbarXRail, { display: '' });
1269
+ set(this.scrollbarYRail, { display: '' });
1270
+ };
1271
+
1272
+ PerfectScrollbar.prototype.onScroll = function onScroll (e) {
1273
+ if (!this.isAlive) {
1274
+ return;
1275
+ }
1276
+
1277
+ updateGeometry(this);
1278
+ processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
1279
+ processScrollDiff(
1280
+ this,
1281
+ 'left',
1282
+ this.element.scrollLeft - this.lastScrollLeft
1283
+ );
1284
+
1285
+ this.lastScrollTop = Math.floor(this.element.scrollTop);
1286
+ this.lastScrollLeft = this.element.scrollLeft;
1287
+ };
1288
+
1289
+ PerfectScrollbar.prototype.destroy = function destroy () {
1290
+ if (!this.isAlive) {
1291
+ return;
1292
+ }
1293
+
1294
+ this.event.unbindAll();
1295
+ remove(this.scrollbarX);
1296
+ remove(this.scrollbarY);
1297
+ remove(this.scrollbarXRail);
1298
+ remove(this.scrollbarYRail);
1299
+ this.removePsClasses();
1300
+
1301
+ // unset elements
1302
+ this.element = null;
1303
+ this.scrollbarX = null;
1304
+ this.scrollbarY = null;
1305
+ this.scrollbarXRail = null;
1306
+ this.scrollbarYRail = null;
1307
+
1308
+ this.isAlive = false;
1309
+ };
1310
+
1311
+ PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
1312
+ this.element.className = this.element.className
1313
+ .split(' ')
1314
+ .filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
1315
+ .join(' ');
1316
+ };
1317
+
1318
+ module.exports = PerfectScrollbar;