Skip to content

Commit

Permalink
Release v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogasparin committed Aug 8, 2014
1 parent a95aeca commit 31913fd
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 24 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "optiscroll",
"version": "1.0.4",
"version": "1.0.5",
"homepage": "https://github.com/wilsonfletcher/optiScroll",
"authors": [
"Alberto Gasparin <albertogasparin@gmail.com>"
Expand Down
28 changes: 19 additions & 9 deletions dist/jquery.optiscroll.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Optiscroll.js v1.0.4
* Optiscroll.js v1.0.5
* https://github.com/wilsonfletcher/Optiscroll/
* by Alberto Gasparin
*
Expand Down Expand Up @@ -87,17 +87,20 @@ Optiscroll.Instance.prototype = {
var me = this,
settings = me.settings;

// add instance to global array for timed check
if(settings.autoUpdate) {
G.instances.push( me );
}

// initialize scrollbars
me.scrollbars = {
v: new Scrollbar('v', me),
h: new Scrollbar('h', me)
};

// Stop initialization if old IE
if(!document.addEventListener) { return; }

// add instance to global array for timed check
if(settings.autoUpdate) {
G.instances.push( me );
}

// disable forced scrollbars if Firefox
// because we cannot hide native scrollbars yet
if(G.nativeScrollbarSize === 0 && 'mozRequestAnimationFrame' in window) {
Expand Down Expand Up @@ -184,7 +187,7 @@ Optiscroll.Instance.prototype = {
if( oldcH !== undefined ) {

// if the element is no more in the DOM
if(sH === 0 && cH === 0 && !document.body.contains(me.element)) {
if(sH === 0 && cH === 0 && !Utils.containsNode(document.body, me.element)) {
me.destroy();
return false;
}
Expand Down Expand Up @@ -711,6 +714,13 @@ var Utils = {
},


containsNode: function (parent, node) {
return parent.contains ?
parent != node && parent.contains(node) :
!!(parent.compareDocumentPosition(node) & 16);
},


// Global height checker
// looped to listen element changes
checkLoop: function () {
Expand Down Expand Up @@ -745,7 +755,7 @@ var Utils = {
var G = Optiscroll.G = {
isTouch: 'ontouchstart' in window,
cssTransition: cssTest('transition'),
cssTransform: cssTest('transform'),
cssTransform: cssTest('transform') || '',
nativeScrollbarSize: getScrollbarWidth(),

instances: [],
Expand Down Expand Up @@ -773,7 +783,7 @@ function getScrollbarWidth () {
outerEl, innerEl, width = 0;

outerEl = document.createElement('div');
outerEl.style.cssText = 'overflow:auto;width:50px;height:50px;' + 'position:absolute;left:-100px';
outerEl.style.cssText = 'overflow:scroll;width:50px;height:50px;' + 'position:absolute;left:-100px';

innerEl = document.createElement('div');
innerEl.style.cssText = 'width:100px;height:100px';
Expand Down

0 comments on commit 31913fd

Please sign in to comment.