Skip to content

Commit 728a92d

Browse files
committed
fixed merge conflicts
2 parents e696fef + 2cbe6a9 commit 728a92d

10 files changed

+79
-54
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "malihu-custom-scrollbar-plugin",
3-
"version": "3.0.8",
3+
"version": "3.0.9",
44
"title": "malihu custom scrollbar plugin",
55
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support, user defined callbacks etc.",
66
"main": [

jquery.mCustomScrollbar.concat.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery.mCustomScrollbar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ CONTENTS:
2525
*/
2626

2727
.mCustomScrollbar{ -ms-touch-action: none; touch-action: none; /* MSPointer events - direct all pointer events to js */ }
28-
.mCustomScrollbar.mCS_no_scrollbar{ -ms-touch-action: auto; touch-action: auto; }
28+
.mCustomScrollbar.mCS_no_scrollbar, .mCustomScrollbar.mCS_touch_action{ -ms-touch-action: auto; touch-action: auto; }
2929

3030
.mCustomScrollBox{ /* contains plugin's markup */
3131
position: relative;

jquery.mCustomScrollbar.js

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
== malihu jquery custom scrollbar plugin ==
3-
Version: 3.0.8
3+
Version: 3.0.9
44
Plugin URI: http://manos.malihu.gr/jquery-custom-content-scroller
55
Author: malihu
66
Author URI: http://manos.malihu.gr
@@ -282,7 +282,7 @@ and dependencies (minified).
282282
auto-update scrollbars each time each image inside the element is fully loaded
283283
values: boolean
284284
*/
285-
updateOnImageLoad:true
285+
updateOnImageLoad:true,
286286
/*
287287
auto-update scrollbars based on the amount and size changes of specific selectors
288288
useful when you need to update the scrollbar(s) automatically, each time a type of element is added, removed or changes its size
@@ -298,6 +298,11 @@ and dependencies (minified).
298298
-------------------------------------
299299
releaseDraggableSelectors null
300300
*/
301+
/*
302+
auto-update timeout
303+
values: integer (milliseconds)
304+
*/
305+
autoUpdateTimeout:60
301306
},
302307
/*
303308
scrollbar theme
@@ -1266,6 +1271,7 @@ and dependencies (minified).
12661271
function _onTouchstart(e){
12671272
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){touchable=0; return;}
12681273
touchable=1; touchDrag=0; docDrag=0;
1274+
$this.removeClass("mCS_touch_action");
12691275
var offset=mCSB_container.offset();
12701276
dragY=_coordinates(e)[0]-offset.top;
12711277
dragX=_coordinates(e)[1]-offset.left;
@@ -1289,7 +1295,13 @@ and dependencies (minified).
12891295
var limitX=mCSB_dragger[1].parent().width()-mCSB_dragger[1].width(),
12901296
preventX=((dragX-x)>0 && (x-dragX)>-(limitX*d.scrollRatio.x) && (touchIntent[2]*2<touchIntent[3] || o.axis==="yx"));
12911297
}
1292-
if(prevent || preventX){e.preventDefault(); touchDrag=1;}else{docDrag=1;} /* prevent native document scrolling */
1298+
if(prevent || preventX){ /* prevent native document scrolling */
1299+
e.preventDefault();
1300+
touchDrag=1;
1301+
}else{
1302+
docDrag=1;
1303+
$this.addClass("mCS_touch_action");
1304+
}
12931305
amount=o.axis==="yx" ? [(dragY-y),(dragX-x)] : o.axis==="x" ? [null,(dragX-x)] : [(dragY-y),null];
12941306
mCSB_container[0].idleTimer=250;
12951307
if(d.overflowed[0]){_drag(amount[0],durA,easing,"y","all",true);}
@@ -1411,28 +1423,27 @@ and dependencies (minified).
14111423
via mouse-wheel plugin (https://github.com/brandonaaron/jquery-mousewheel)
14121424
*/
14131425
_mousewheel=function(){
1426+
if(!$(this).data(pluginPfx)){return;} /* Check if the scrollbar is ready to use mousewheel events (issue: #185) */
14141427
var $this=$(this),d=$this.data(pluginPfx),o=d.opt,
14151428
namespace=pluginPfx+"_"+d.idx,
14161429
mCustomScrollBox=$("#mCSB_"+d.idx),
14171430
mCSB_dragger=[$("#mCSB_"+d.idx+"_dragger_vertical"),$("#mCSB_"+d.idx+"_dragger_horizontal")],
14181431
iframe=$("#mCSB_"+d.idx+"_container").find("iframe");
1419-
if(d){ /* Check if the scrollbar is ready to use mousewheel events (issue: #185) */
1420-
if(iframe.length){
1421-
iframe.each(function(){
1422-
$(this).load(function(){
1423-
/* bind events on accessible iframes */
1424-
if(_canAccessIFrame(this)){
1425-
$(this.contentDocument || this.contentWindow.document).bind("mousewheel."+namespace,function(e,delta){
1426-
_onMousewheel(e,delta);
1427-
});
1428-
}
1429-
});
1432+
if(iframe.length){
1433+
iframe.each(function(){
1434+
$(this).load(function(){
1435+
/* bind events on accessible iframes */
1436+
if(_canAccessIFrame(this)){
1437+
$(this.contentDocument || this.contentWindow.document).bind("mousewheel."+namespace,function(e,delta){
1438+
_onMousewheel(e,delta);
1439+
});
1440+
}
14301441
});
1431-
}
1432-
mCustomScrollBox.bind("mousewheel."+namespace,function(e,delta){
1433-
_onMousewheel(e,delta);
14341442
});
14351443
}
1444+
mCustomScrollBox.bind("mousewheel."+namespace,function(e,delta){
1445+
_onMousewheel(e,delta);
1446+
});
14361447
function _onMousewheel(e,delta){
14371448
_stop($this);
14381449
if(_disableMousewheel($this,e.target)){return;} /* disables mouse-wheel when hovering specific elements */
@@ -1455,7 +1466,7 @@ and dependencies (minified).
14551466
dlt=e.deltaY || delta;
14561467
}
14571468
if((dir==="y" && !d.overflowed[0]) || (dir==="x" && !d.overflowed[1])){return;}
1458-
if(o.mouseWheel.invert){dlt=-dlt;}
1469+
if(o.mouseWheel.invert || e.webkitDirectionInvertedFromDevice){dlt=-dlt;}
14591470
if(o.mouseWheel.normalizeDelta){dlt=dlt<0 ? -1 : 1;}
14601471
if((dlt>0 && draggerPos!==0) || (dlt<0 && draggerPos!==limit) || o.mouseWheel.preventDefault){
14611472
e.stopImmediatePropagation();
@@ -1870,13 +1881,11 @@ and dependencies (minified).
18701881
upd();
18711882
function upd(){
18721883
clearTimeout(mCSB_container[0].autoUpdate);
1873-
1874-
/* check scroller in dom tree */
1875-
if($this.parents('html').length===0){
1876-
$this = null;
1884+
if($this.parents("html").length===0){
1885+
/* check element in dom tree */
1886+
$this=null;
18771887
return;
18781888
}
1879-
18801889
mCSB_container[0].autoUpdate=setTimeout(function(){
18811890
/* update on specific selector(s) length and size change */
18821891
if(o.advanced.updateOnSelectorChange){
@@ -1906,7 +1915,7 @@ and dependencies (minified).
19061915
}
19071916
}
19081917
if(o.advanced.updateOnSelectorChange || o.advanced.updateOnContentResize || o.advanced.updateOnImageLoad){upd();}
1909-
},60);
1918+
},o.advanced.autoUpdateTimeout);
19101919
}
19111920
/* returns images amount */
19121921
function imgSum(){

jquery.mCustomScrollbar.min.css

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

js/minified/jquery.mCustomScrollbar.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
74 Bytes
Binary file not shown.

js/uncompressed/jquery.mCustomScrollbar.js

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
== malihu jquery custom scrollbar plugin ==
3-
Version: 3.0.8
3+
Version: 3.0.9
44
Plugin URI: http://manos.malihu.gr/jquery-custom-content-scroller
55
Author: malihu
66
Author URI: http://manos.malihu.gr
@@ -282,7 +282,7 @@ and dependencies (minified).
282282
auto-update scrollbars each time each image inside the element is fully loaded
283283
values: boolean
284284
*/
285-
updateOnImageLoad:true
285+
updateOnImageLoad:true,
286286
/*
287287
auto-update scrollbars based on the amount and size changes of specific selectors
288288
useful when you need to update the scrollbar(s) automatically, each time a type of element is added, removed or changes its size
@@ -298,6 +298,11 @@ and dependencies (minified).
298298
-------------------------------------
299299
releaseDraggableSelectors null
300300
*/
301+
/*
302+
auto-update timeout
303+
values: integer (milliseconds)
304+
*/
305+
autoUpdateTimeout:60
301306
},
302307
/*
303308
scrollbar theme
@@ -1266,6 +1271,7 @@ and dependencies (minified).
12661271
function _onTouchstart(e){
12671272
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){touchable=0; return;}
12681273
touchable=1; touchDrag=0; docDrag=0;
1274+
$this.removeClass("mCS_touch_action");
12691275
var offset=mCSB_container.offset();
12701276
dragY=_coordinates(e)[0]-offset.top;
12711277
dragX=_coordinates(e)[1]-offset.left;
@@ -1289,7 +1295,13 @@ and dependencies (minified).
12891295
var limitX=mCSB_dragger[1].parent().width()-mCSB_dragger[1].width(),
12901296
preventX=((dragX-x)>0 && (x-dragX)>-(limitX*d.scrollRatio.x) && (touchIntent[2]*2<touchIntent[3] || o.axis==="yx"));
12911297
}
1292-
if(prevent || preventX){e.preventDefault(); touchDrag=1;}else{docDrag=1;} /* prevent native document scrolling */
1298+
if(prevent || preventX){ /* prevent native document scrolling */
1299+
e.preventDefault();
1300+
touchDrag=1;
1301+
}else{
1302+
docDrag=1;
1303+
$this.addClass("mCS_touch_action");
1304+
}
12931305
amount=o.axis==="yx" ? [(dragY-y),(dragX-x)] : o.axis==="x" ? [null,(dragX-x)] : [(dragY-y),null];
12941306
mCSB_container[0].idleTimer=250;
12951307
if(d.overflowed[0]){_drag(amount[0],durA,easing,"y","all",true);}
@@ -1411,28 +1423,27 @@ and dependencies (minified).
14111423
via mouse-wheel plugin (https://github.com/brandonaaron/jquery-mousewheel)
14121424
*/
14131425
_mousewheel=function(){
1426+
if(!$(this).data(pluginPfx)){return;} /* Check if the scrollbar is ready to use mousewheel events (issue: #185) */
14141427
var $this=$(this),d=$this.data(pluginPfx),o=d.opt,
14151428
namespace=pluginPfx+"_"+d.idx,
14161429
mCustomScrollBox=$("#mCSB_"+d.idx),
14171430
mCSB_dragger=[$("#mCSB_"+d.idx+"_dragger_vertical"),$("#mCSB_"+d.idx+"_dragger_horizontal")],
14181431
iframe=$("#mCSB_"+d.idx+"_container").find("iframe");
1419-
if(d){ /* Check if the scrollbar is ready to use mousewheel events (issue: #185) */
1420-
if(iframe.length){
1421-
iframe.each(function(){
1422-
$(this).load(function(){
1423-
/* bind events on accessible iframes */
1424-
if(_canAccessIFrame(this)){
1425-
$(this.contentDocument || this.contentWindow.document).bind("mousewheel."+namespace,function(e,delta){
1426-
_onMousewheel(e,delta);
1427-
});
1428-
}
1429-
});
1432+
if(iframe.length){
1433+
iframe.each(function(){
1434+
$(this).load(function(){
1435+
/* bind events on accessible iframes */
1436+
if(_canAccessIFrame(this)){
1437+
$(this.contentDocument || this.contentWindow.document).bind("mousewheel."+namespace,function(e,delta){
1438+
_onMousewheel(e,delta);
1439+
});
1440+
}
14301441
});
1431-
}
1432-
mCustomScrollBox.bind("mousewheel."+namespace,function(e,delta){
1433-
_onMousewheel(e,delta);
14341442
});
14351443
}
1444+
mCustomScrollBox.bind("mousewheel."+namespace,function(e,delta){
1445+
_onMousewheel(e,delta);
1446+
});
14361447
function _onMousewheel(e,delta){
14371448
_stop($this);
14381449
if(_disableMousewheel($this,e.target)){return;} /* disables mouse-wheel when hovering specific elements */
@@ -1455,7 +1466,7 @@ and dependencies (minified).
14551466
dlt=e.deltaY || delta;
14561467
}
14571468
if((dir==="y" && !d.overflowed[0]) || (dir==="x" && !d.overflowed[1])){return;}
1458-
if(o.mouseWheel.invert){dlt=-dlt;}
1469+
if(o.mouseWheel.invert || e.webkitDirectionInvertedFromDevice){dlt=-dlt;}
14591470
if(o.mouseWheel.normalizeDelta){dlt=dlt<0 ? -1 : 1;}
14601471
if((dlt>0 && draggerPos!==0) || (dlt<0 && draggerPos!==limit) || o.mouseWheel.preventDefault){
14611472
e.stopImmediatePropagation();
@@ -1870,6 +1881,11 @@ and dependencies (minified).
18701881
upd();
18711882
function upd(){
18721883
clearTimeout(mCSB_container[0].autoUpdate);
1884+
if($this.parents("html").length===0){
1885+
/* check element in dom tree */
1886+
$this=null;
1887+
return;
1888+
}
18731889
mCSB_container[0].autoUpdate=setTimeout(function(){
18741890
/* update on specific selector(s) length and size change */
18751891
if(o.advanced.updateOnSelectorChange){
@@ -1899,7 +1915,7 @@ and dependencies (minified).
18991915
}
19001916
}
19011917
if(o.advanced.updateOnSelectorChange || o.advanced.updateOnContentResize || o.advanced.updateOnImageLoad){upd();}
1902-
},60);
1918+
},o.advanced.autoUpdateTimeout);
19031919
}
19041920
/* returns images amount */
19051921
function imgSum(){

malihu-custom-scrollbar-plugin.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"custom-scrollbar",
88
"scrollbar"
99
],
10-
"version": "3.0.8",
10+
"version": "3.0.9",
1111
"author": {
1212
"name": "malihu",
1313
"url": "http://manos.malihu.gr"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "malihu-custom-scrollbar-plugin",
3-
"version": "3.0.8",
3+
"version": "3.0.9",
44
"author": "malihu (http://manos.malihu.gr)",
55
"description": "Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support user defined callbacks etc.",
66
"license": "MIT",

0 commit comments

Comments
 (0)