From 1d745fed11791c1e176ff24805771b8a769c8bd4 Mon Sep 17 00:00:00 2001 From: Scott Jehl Date: Fri, 2 Aug 2013 15:01:50 -0500 Subject: [PATCH] fixed a bug in the return value of toss. All tests are now passing --- dist/overthrow.js | 11 ++++++----- dist/overthrow.sidescroller.js | 11 ++++++----- src/overthrow-toss.js | 5 +++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/dist/overthrow.js b/dist/overthrow.js index 312eaa9..5860a3a 100644 --- a/dist/overthrow.js +++ b/dist/overthrow.js @@ -60,13 +60,13 @@ w.overthrow.enabledClassName = enabledClassName; w.overthrow.addClass = function(){ - if( docElem.className.indexOf( enabledClassName ) === -1 ){ - docElem.className += " " + enabledClassName; + if( docElem.className.indexOf( w.overthrow.enabledClassName ) === -1 ){ + docElem.className += " " + w.overthrow.enabledClassName; } }; w.overthrow.removeClass = function(){ - docElem.className = docElem.className.replace( enabledClassName, "" ); + docElem.className = docElem.className.replace( w.overthrow.enabledClassName, "" ); }; // Enable and potentially polyfill overflow @@ -155,13 +155,14 @@ op.left = op.left - sLeft; } // Then the top val - if( typeof o.top === "string" ){ + if( typeof op.top === "string" ){ + op.top = parseFloat( op.top ); endTop = op.top + sTop; } else { endTop = op.top; - o.top = op.top - sTop; + op.top = op.top - sTop; } o.intercept(); diff --git a/dist/overthrow.sidescroller.js b/dist/overthrow.sidescroller.js index 1936fee..c49b63e 100644 --- a/dist/overthrow.sidescroller.js +++ b/dist/overthrow.sidescroller.js @@ -60,13 +60,13 @@ w.overthrow.enabledClassName = enabledClassName; w.overthrow.addClass = function(){ - if( docElem.className.indexOf( enabledClassName ) === -1 ){ - docElem.className += " " + enabledClassName; + if( docElem.className.indexOf( w.overthrow.enabledClassName ) === -1 ){ + docElem.className += " " + w.overthrow.enabledClassName; } }; w.overthrow.removeClass = function(){ - docElem.className = docElem.className.replace( enabledClassName, "" ); + docElem.className = docElem.className.replace( w.overthrow.enabledClassName, "" ); }; // Enable and potentially polyfill overflow @@ -155,13 +155,14 @@ op.left = op.left - sLeft; } // Then the top val - if( typeof o.top === "string" ){ + if( typeof op.top === "string" ){ + op.top = parseFloat( op.top ); endTop = op.top + sTop; } else { endTop = op.top; - o.top = op.top - sTop; + op.top = op.top - sTop; } o.intercept(); diff --git a/src/overthrow-toss.js b/src/overthrow-toss.js index ddb2e4e..47bb21f 100644 --- a/src/overthrow-toss.js +++ b/src/overthrow-toss.js @@ -59,13 +59,14 @@ op.left = op.left - sLeft; } // Then the top val - if( typeof o.top === "string" ){ + if( typeof op.top === "string" ){ + op.top = parseFloat( op.top ); endTop = op.top + sTop; } else { endTop = op.top; - o.top = op.top - sTop; + op.top = op.top - sTop; } o.intercept();