Skip to content

Commit 4dfa5db

Browse files
committed
add missing jQuery plugin scrollable fallback
1 parent daee5d1 commit 4dfa5db

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/js/scrollable.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import 'simplebar/src/simplebar'
1+
import 'simplebar/src/simplebar.js'
22

33
export default function () {
44

55
$.fn.blScrollable = function () {
6+
67
if (!this.length) return
78
if (this.length > 1) {
89
this.each(function () {
@@ -18,6 +19,11 @@ export default function () {
1819
el.addClass('horizontal')
1920
}
2021

22+
if ($.fn.simplebar === undefined) {
23+
el.css('overflow-y', 'scroll')
24+
return
25+
}
26+
2127
el.simplebar()
2228
el.simplebar().on('scroll', function () {
2329
var scrollable = $(this)

0 commit comments

Comments
 (0)