diff --git a/composer.json b/composer.json index 7e4e034..3ac3e10 100644 --- a/composer.json +++ b/composer.json @@ -5,10 +5,10 @@ "authors": [{ "name": "Jack Lukic", "email": "jacklukic@gmail.com", - "web": "http://www.jacklukic.com", + "homepage": "http://www.jacklukic.com", "role": "Creator" }], "keywords": ["semantic", "ui", "css", "framework"], "license": "MIT", - "version": "2.4.1" + "version": "2.5.0" } \ No newline at end of file diff --git a/index.js b/index.js index a81763e..074bedc 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 2.4.1 - Visibility + * # Semantic UI 2.5.0 - Visibility * http://github.com/semantic-org/semantic-ui/ * * diff --git a/package.json b/package.json index a259750..38f1364 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "semantic-ui-visibility", - "version": "2.4.1", + "version": "2.5.0", "title": "Semantic UI - Visibility", "description": "Single component release of visibility", "homepage": "http://www.semantic-ui.com", diff --git a/visibility.js b/visibility.js index 09a7de9..30210ce 100644 --- a/visibility.js +++ b/visibility.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 2.4.1 - Visibility + * # Semantic UI 2.5.0 - Visibility * http://github.com/semantic-org/semantic-ui/ * * diff --git a/visibility.min.js b/visibility.min.js index bcbfcc0..77dca09 100644 --- a/visibility.min.js +++ b/visibility.min.js @@ -1 +1 @@ -!function(O,z,A,w){"use strict";z=void 0!==z&&z.Math==Math?z:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),O.fn.visibility=function(h){var P,e=O(this),x=e.selector||"",C=(new Date).getTime(),y=[],S=h,R="string"==typeof S,V=[].slice.call(arguments,1),k=e.length,T=0;return e.each(function(){var e,o,n,r,i=O.isPlainObject(h)?O.extend(!0,{},O.fn.visibility.settings,h):O.extend({},O.fn.visibility.settings),t=i.className,s=i.namespace,a=i.error,c=i.metadata,l="."+s,d="module-"+s,u=O(z),f=O(this),b=O(i.context),g=(f.selector,f.data(d)),m=z.requestAnimationFrame||z.mozRequestAnimationFrame||z.webkitRequestAnimationFrame||z.msRequestAnimationFrame||function(e){setTimeout(e,0)},p=this,v=!1;r={initialize:function(){r.debug("Initializing",i),r.setup.cache(),r.should.trackChanges()&&("image"==i.type&&r.setup.image(),"fixed"==i.type&&r.setup.fixed(),i.observeChanges&&r.observeChanges(),r.bind.events()),r.save.position(),r.is.visible()||r.error(a.visible,f),i.initialCheck&&r.checkVisibility(),r.instantiate()},instantiate:function(){r.debug("Storing instance",r),f.data(d,r),g=r},destroy:function(){r.verbose("Destroying previous module"),n&&n.disconnect(),o&&o.disconnect(),u.off("load"+l,r.event.load).off("resize"+l,r.event.resize),b.off("scroll"+l,r.event.scroll).off("scrollchange"+l,r.event.scrollchange),"fixed"==i.type&&(r.resetFixed(),r.remove.placeholder()),f.off(l).removeData(d)},observeChanges:function(){"MutationObserver"in z&&(o=new MutationObserver(r.event.contextChanged),n=new MutationObserver(r.event.changed),o.observe(A,{childList:!0,subtree:!0}),n.observe(p,{childList:!0,subtree:!0}),r.debug("Setting up mutation observer",n))},bind:{events:function(){r.verbose("Binding visibility events to scroll and resize"),i.refreshOnLoad&&u.on("load"+l,r.event.load),u.on("resize"+l,r.event.resize),b.off("scroll"+l).on("scroll"+l,r.event.scroll).on("scrollchange"+l,r.event.scrollchange)}},event:{changed:function(e){r.verbose("DOM tree modified, updating visibility calculations"),r.timer=setTimeout(function(){r.verbose("DOM tree modified, updating sticky menu"),r.refresh()},100)},contextChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==p||0=e.length&&O.isFunction(o)&&o()};n--;)(s=A.createElement("img")).onload=c,s.onerror=c,s.src=e[n],i.push(s)},enableCallbacks:function(){r.debug("Allowing callbacks to occur"),v=!1},disableCallbacks:function(){r.debug("Disabling all callbacks temporarily"),v=!0},should:{trackChanges:function(){return R?(r.debug("One time query, no need to bind events"),!1):(r.debug("Callbacks being attached"),!0)}},setup:{cache:function(){r.cache={occurred:{},screen:{},element:{}}},image:function(){var e=f.data(c.src);e&&(r.verbose("Lazy loading image",e),i.once=!0,i.observeChanges=!1,i.onOnScreen=function(){r.debug("Image on screen",p),r.precache(e,function(){r.set.image(e,function(){++T==k&&i.onAllLoaded.call(this),i.onLoad.call(this)})})})},fixed:function(){r.debug("Setting up fixed"),i.once=!1,i.observeChanges=!1,i.initialCheck=!0,i.refreshOnLoad=!0,h.transition||(i.transition=!1),r.create.placeholder(),r.debug("Added placeholder",e),i.onTopPassed=function(){r.debug("Element passed, adding fixed position",f),r.show.placeholder(),r.set.fixed(),i.transition&&O.fn.transition!==w&&f.transition(i.transition,i.duration)},i.onTopPassedReverse=function(){r.debug("Element returned to position, removing fixed",f),r.hide.placeholder(),r.remove.fixed()}}},create:{placeholder:function(){r.verbose("Creating fixed position placeholder"),e=f.clone(!1).css("display","none").addClass(t.placeholder).insertAfter(f)}},show:{placeholder:function(){r.verbose("Showing placeholder"),e.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){r.verbose("Hiding placeholder"),e.css("display","none").css("visibility","")}},set:{fixed:function(){r.verbose("Setting element to fixed position"),f.addClass(t.fixed).css({position:"fixed",top:i.offset+"px",left:"auto",zIndex:i.zIndex}),i.onFixed.call(p)},image:function(e,o){if(f.attr("src",e),i.transition)if(O.fn.transition!==w){if(f.hasClass(t.visible))return void r.debug("Transition already occurred on this image, skipping animation");f.transition(i.transition,i.duration,o)}else f.fadeIn(i.duration,o);else f.show()}},is:{onScreen:function(){return r.get.elementCalculations().onScreen},offScreen:function(){return r.get.elementCalculations().offScreen},visible:function(){return!(!r.cache||!r.cache.element)&&!(0===r.cache.element.width&&0===r.cache.element.offset.top)},verticallyScrollableContext:function(){var e=b.get(0)!==z&&b.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=b.get(0)!==z&&b.css("overflow-x");return"auto"==e||"scroll"==e}},refresh:function(){r.debug("Refreshing constants (width/height)"),"fixed"==i.type&&r.resetFixed(),r.reset(),r.save.position(),i.checkOnRefresh&&r.checkVisibility(),i.onRefresh.call(p)},resetFixed:function(){r.remove.fixed(),r.remove.occurred()},reset:function(){r.verbose("Resetting all cached values"),O.isPlainObject(r.cache)&&(r.cache.screen={},r.cache.element={})},checkVisibility:function(e){r.verbose("Checking visibility of element",r.cache.element),!v&&r.is.visible()&&(r.save.scroll(e),r.save.calculations(),r.passed(),r.passingReverse(),r.topVisibleReverse(),r.bottomVisibleReverse(),r.topPassedReverse(),r.bottomPassedReverse(),r.onScreen(),r.offScreen(),r.passing(),r.topVisible(),r.bottomVisible(),r.topPassed(),r.bottomPassed(),i.onUpdate&&i.onUpdate.call(p,r.get.elementCalculations()))},passed:function(e,o){var n=r.get.elementCalculations();if(e&&o)i.onPassed[e]=o;else{if(e!==w)return r.get.pixelsPassed(e)>n.pixelsPassed;n.passing&&O.each(i.onPassed,function(e,o){n.bottomVisible||n.pixelsPassed>r.get.pixelsPassed(e)?r.execute(o,e):i.once||r.remove.occurred(o)})}},onScreen:function(e){var o=r.get.elementCalculations(),n=e||i.onOnScreen,t="onScreen";if(e&&(r.debug("Adding callback for onScreen",e),i.onOnScreen=e),o.onScreen?r.execute(n,t):i.once||r.remove.occurred(t),e!==w)return o.onOnScreen},offScreen:function(e){var o=r.get.elementCalculations(),n=e||i.onOffScreen,t="offScreen";if(e&&(r.debug("Adding callback for offScreen",e),i.onOffScreen=e),o.offScreen?r.execute(n,t):i.once||r.remove.occurred(t),e!==w)return o.onOffScreen},passing:function(e){var o=r.get.elementCalculations(),n=e||i.onPassing,t="passing";if(e&&(r.debug("Adding callback for passing",e),i.onPassing=e),o.passing?r.execute(n,t):i.once||r.remove.occurred(t),e!==w)return o.passing},topVisible:function(e){var o=r.get.elementCalculations(),n=e||i.onTopVisible,t="topVisible";if(e&&(r.debug("Adding callback for top visible",e),i.onTopVisible=e),o.topVisible?r.execute(n,t):i.once||r.remove.occurred(t),e===w)return o.topVisible},bottomVisible:function(e){var o=r.get.elementCalculations(),n=e||i.onBottomVisible,t="bottomVisible";if(e&&(r.debug("Adding callback for bottom visible",e),i.onBottomVisible=e),o.bottomVisible?r.execute(n,t):i.once||r.remove.occurred(t),e===w)return o.bottomVisible},topPassed:function(e){var o=r.get.elementCalculations(),n=e||i.onTopPassed,t="topPassed";if(e&&(r.debug("Adding callback for top passed",e),i.onTopPassed=e),o.topPassed?r.execute(n,t):i.once||r.remove.occurred(t),e===w)return o.topPassed},bottomPassed:function(e){var o=r.get.elementCalculations(),n=e||i.onBottomPassed,t="bottomPassed";if(e&&(r.debug("Adding callback for bottom passed",e),i.onBottomPassed=e),o.bottomPassed?r.execute(n,t):i.once||r.remove.occurred(t),e===w)return o.bottomPassed},passingReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onPassingReverse,t="passingReverse";if(e&&(r.debug("Adding callback for passing reverse",e),i.onPassingReverse=e),o.passing?i.once||r.remove.occurred(t):r.get.occurred("passing")&&r.execute(n,t),e!==w)return!o.passing},topVisibleReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onTopVisibleReverse,t="topVisibleReverse";if(e&&(r.debug("Adding callback for top visible reverse",e),i.onTopVisibleReverse=e),o.topVisible?i.once||r.remove.occurred(t):r.get.occurred("topVisible")&&r.execute(n,t),e===w)return!o.topVisible},bottomVisibleReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onBottomVisibleReverse,t="bottomVisibleReverse";if(e&&(r.debug("Adding callback for bottom visible reverse",e),i.onBottomVisibleReverse=e),o.bottomVisible?i.once||r.remove.occurred(t):r.get.occurred("bottomVisible")&&r.execute(n,t),e===w)return!o.bottomVisible},topPassedReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onTopPassedReverse,t="topPassedReverse";if(e&&(r.debug("Adding callback for top passed reverse",e),i.onTopPassedReverse=e),o.topPassed?i.once||r.remove.occurred(t):r.get.occurred("topPassed")&&r.execute(n,t),e===w)return!o.onTopPassed},bottomPassedReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onBottomPassedReverse,t="bottomPassedReverse";if(e&&(r.debug("Adding callback for bottom passed reverse",e),i.onBottomPassedReverse=e),o.bottomPassed?i.once||r.remove.occurred(t):r.get.occurred("bottomPassed")&&r.execute(n,t),e===w)return!o.bottomPassed},execute:function(e,o){var n=r.get.elementCalculations(),t=r.get.screenCalculations();(e=e||!1)&&(i.continuous?(r.debug("Callback being called continuously",o,n),e.call(p,n,t)):r.get.occurred(o)||(r.debug("Conditions met",o,n),e.call(p,n,t))),r.save.occurred(o)},remove:{fixed:function(){r.debug("Removing fixed position"),f.removeClass(t.fixed).css({position:"",top:"",left:"",zIndex:""}),i.onUnfixed.call(p)},placeholder:function(){r.debug("Removing placeholder content"),e&&e.remove()},occurred:function(e){if(e){var o=r.cache.occurred;o[e]!==w&&!0===o[e]&&(r.debug("Callback can now be called again",e),r.cache.occurred[e]=!1)}else r.cache.occurred={}}},save:{calculations:function(){r.verbose("Saving all calculations necessary to determine positioning"),r.save.direction(),r.save.screenCalculations(),r.save.elementCalculations()},occurred:function(e){e&&(r.cache.occurred[e]!==w&&!0===r.cache.occurred[e]||(r.verbose("Saving callback occurred",e),r.cache.occurred[e]=!0))},scroll:function(e){e=e+i.offset||b.scrollTop()+i.offset,r.cache.scroll=e},direction:function(){var e,o=r.get.scroll(),n=r.get.lastScroll();return e=n=o.top,o.bottomPassed=e.top>=o.bottom,o.topVisible=e.bottom>=o.top&&!o.topPassed,o.bottomVisible=e.bottom>=o.bottom&&!o.bottomPassed,o.pixelsPassed=0,o.percentagePassed=0,o.onScreen=(o.topVisible||o.passing)&&!o.bottomPassed,o.passing=o.topPassed&&!o.bottomPassed,o.offScreen=!o.onScreen,o.passing&&(o.pixelsPassed=e.top-o.top,o.percentagePassed=(e.top-o.top)/o.height),r.cache.element=o,r.verbose("Updated element calculations",o),o},screenCalculations:function(){var e=r.get.scroll();return r.save.direction(),r.cache.screen.top=e,r.cache.screen.bottom=e+r.cache.screen.height,r.cache.screen},screenSize:function(){r.verbose("Saving window position"),r.cache.screen={height:b.height()}},position:function(){r.save.screenSize(),r.save.elementPosition()}},get:{pixelsPassed:function(e){var o=r.get.elementCalculations();return-1=e.length&&O.isFunction(o)&&o()};n--;)(s=A.createElement("img")).onload=c,s.onerror=c,s.src=e[n],i.push(s)},enableCallbacks:function(){v.debug("Allowing callbacks to occur"),p=!1},disableCallbacks:function(){v.debug("Disabling all callbacks temporarily"),p=!0},should:{trackChanges:function(){return R?(v.debug("One time query, no need to bind events"),!1):(v.debug("Callbacks being attached"),!0)}},setup:{cache:function(){v.cache={occurred:{},screen:{},element:{}}},image:function(){var e=u.data(c.src);e&&(v.verbose("Lazy loading image",e),i.once=!0,i.observeChanges=!1,i.onOnScreen=function(){v.debug("Image on screen",m),v.precache(e,function(){v.set.image(e,function(){++T==k&&i.onAllLoaded.call(this),i.onLoad.call(this)})})})},fixed:function(){v.debug("Setting up fixed"),i.once=!1,i.observeChanges=!1,i.initialCheck=!0,i.refreshOnLoad=!0,h.transition||(i.transition=!1),v.create.placeholder(),v.debug("Added placeholder",e),i.onTopPassed=function(){v.debug("Element passed, adding fixed position",u),v.show.placeholder(),v.set.fixed(),i.transition&&O.fn.transition!==w&&u.transition(i.transition,i.duration)},i.onTopPassedReverse=function(){v.debug("Element returned to position, removing fixed",u),v.hide.placeholder(),v.remove.fixed()}}},create:{placeholder:function(){v.verbose("Creating fixed position placeholder"),e=u.clone(!1).css("display","none").addClass(t.placeholder).insertAfter(u)}},show:{placeholder:function(){v.verbose("Showing placeholder"),e.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){v.verbose("Hiding placeholder"),e.css("display","none").css("visibility","")}},set:{fixed:function(){v.verbose("Setting element to fixed position"),u.addClass(t.fixed).css({position:"fixed",top:i.offset+"px",left:"auto",zIndex:i.zIndex}),i.onFixed.call(m)},image:function(e,o){if(u.attr("src",e),i.transition)if(O.fn.transition!==w){if(u.hasClass(t.visible))return void v.debug("Transition already occurred on this image, skipping animation");u.transition(i.transition,i.duration,o)}else u.fadeIn(i.duration,o);else u.show()}},is:{onScreen:function(){return v.get.elementCalculations().onScreen},offScreen:function(){return v.get.elementCalculations().offScreen},visible:function(){return!(!v.cache||!v.cache.element)&&!(0===v.cache.element.width&&0===v.cache.element.offset.top)},verticallyScrollableContext:function(){var e=f.get(0)!==z&&f.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=f.get(0)!==z&&f.css("overflow-x");return"auto"==e||"scroll"==e}},refresh:function(){v.debug("Refreshing constants (width/height)"),"fixed"==i.type&&v.resetFixed(),v.reset(),v.save.position(),i.checkOnRefresh&&v.checkVisibility(),i.onRefresh.call(m)},resetFixed:function(){v.remove.fixed(),v.remove.occurred()},reset:function(){v.verbose("Resetting all cached values"),O.isPlainObject(v.cache)&&(v.cache.screen={},v.cache.element={})},checkVisibility:function(e){v.verbose("Checking visibility of element",v.cache.element),!p&&v.is.visible()&&(v.save.scroll(e),v.save.calculations(),v.passed(),v.passingReverse(),v.topVisibleReverse(),v.bottomVisibleReverse(),v.topPassedReverse(),v.bottomPassedReverse(),v.onScreen(),v.offScreen(),v.passing(),v.topVisible(),v.bottomVisible(),v.topPassed(),v.bottomPassed(),i.onUpdate&&i.onUpdate.call(m,v.get.elementCalculations()))},passed:function(e,o){var n=v.get.elementCalculations();if(e&&o)i.onPassed[e]=o;else{if(e!==w)return v.get.pixelsPassed(e)>n.pixelsPassed;n.passing&&O.each(i.onPassed,function(e,o){n.bottomVisible||n.pixelsPassed>v.get.pixelsPassed(e)?v.execute(o,e):i.once||v.remove.occurred(o)})}},onScreen:function(e){var o=v.get.elementCalculations(),n=e||i.onOnScreen,t="onScreen";if(e&&(v.debug("Adding callback for onScreen",e),i.onOnScreen=e),o.onScreen?v.execute(n,t):i.once||v.remove.occurred(t),e!==w)return o.onOnScreen},offScreen:function(e){var o=v.get.elementCalculations(),n=e||i.onOffScreen,t="offScreen";if(e&&(v.debug("Adding callback for offScreen",e),i.onOffScreen=e),o.offScreen?v.execute(n,t):i.once||v.remove.occurred(t),e!==w)return o.onOffScreen},passing:function(e){var o=v.get.elementCalculations(),n=e||i.onPassing,t="passing";if(e&&(v.debug("Adding callback for passing",e),i.onPassing=e),o.passing?v.execute(n,t):i.once||v.remove.occurred(t),e!==w)return o.passing},topVisible:function(e){var o=v.get.elementCalculations(),n=e||i.onTopVisible,t="topVisible";if(e&&(v.debug("Adding callback for top visible",e),i.onTopVisible=e),o.topVisible?v.execute(n,t):i.once||v.remove.occurred(t),e===w)return o.topVisible},bottomVisible:function(e){var o=v.get.elementCalculations(),n=e||i.onBottomVisible,t="bottomVisible";if(e&&(v.debug("Adding callback for bottom visible",e),i.onBottomVisible=e),o.bottomVisible?v.execute(n,t):i.once||v.remove.occurred(t),e===w)return o.bottomVisible},topPassed:function(e){var o=v.get.elementCalculations(),n=e||i.onTopPassed,t="topPassed";if(e&&(v.debug("Adding callback for top passed",e),i.onTopPassed=e),o.topPassed?v.execute(n,t):i.once||v.remove.occurred(t),e===w)return o.topPassed},bottomPassed:function(e){var o=v.get.elementCalculations(),n=e||i.onBottomPassed,t="bottomPassed";if(e&&(v.debug("Adding callback for bottom passed",e),i.onBottomPassed=e),o.bottomPassed?v.execute(n,t):i.once||v.remove.occurred(t),e===w)return o.bottomPassed},passingReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onPassingReverse,t="passingReverse";if(e&&(v.debug("Adding callback for passing reverse",e),i.onPassingReverse=e),o.passing?i.once||v.remove.occurred(t):v.get.occurred("passing")&&v.execute(n,t),e!==w)return!o.passing},topVisibleReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onTopVisibleReverse,t="topVisibleReverse";if(e&&(v.debug("Adding callback for top visible reverse",e),i.onTopVisibleReverse=e),o.topVisible?i.once||v.remove.occurred(t):v.get.occurred("topVisible")&&v.execute(n,t),e===w)return!o.topVisible},bottomVisibleReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onBottomVisibleReverse,t="bottomVisibleReverse";if(e&&(v.debug("Adding callback for bottom visible reverse",e),i.onBottomVisibleReverse=e),o.bottomVisible?i.once||v.remove.occurred(t):v.get.occurred("bottomVisible")&&v.execute(n,t),e===w)return!o.bottomVisible},topPassedReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onTopPassedReverse,t="topPassedReverse";if(e&&(v.debug("Adding callback for top passed reverse",e),i.onTopPassedReverse=e),o.topPassed?i.once||v.remove.occurred(t):v.get.occurred("topPassed")&&v.execute(n,t),e===w)return!o.onTopPassed},bottomPassedReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onBottomPassedReverse,t="bottomPassedReverse";if(e&&(v.debug("Adding callback for bottom passed reverse",e),i.onBottomPassedReverse=e),o.bottomPassed?i.once||v.remove.occurred(t):v.get.occurred("bottomPassed")&&v.execute(n,t),e===w)return!o.bottomPassed},execute:function(e,o){var n=v.get.elementCalculations(),t=v.get.screenCalculations();(e=e||!1)&&(i.continuous?(v.debug("Callback being called continuously",o,n),e.call(m,n,t)):v.get.occurred(o)||(v.debug("Conditions met",o,n),e.call(m,n,t))),v.save.occurred(o)},remove:{fixed:function(){v.debug("Removing fixed position"),u.removeClass(t.fixed).css({position:"",top:"",left:"",zIndex:""}),i.onUnfixed.call(m)},placeholder:function(){v.debug("Removing placeholder content"),e&&e.remove()},occurred:function(e){var o;e?(o=v.cache.occurred)[e]!==w&&!0===o[e]&&(v.debug("Callback can now be called again",e),v.cache.occurred[e]=!1):v.cache.occurred={}}},save:{calculations:function(){v.verbose("Saving all calculations necessary to determine positioning"),v.save.direction(),v.save.screenCalculations(),v.save.elementCalculations()},occurred:function(e){e&&(v.cache.occurred[e]!==w&&!0===v.cache.occurred[e]||(v.verbose("Saving callback occurred",e),v.cache.occurred[e]=!0))},scroll:function(e){e=e+i.offset||f.scrollTop()+i.offset,v.cache.scroll=e},direction:function(){var e=v.get.scroll(),o=v.get.lastScroll(),n=o=o.top,o.bottomPassed=e.top>=o.bottom,o.topVisible=e.bottom>=o.top&&!o.topPassed,o.bottomVisible=e.bottom>=o.bottom&&!o.bottomPassed,o.pixelsPassed=0,o.percentagePassed=0,o.onScreen=(o.topVisible||o.passing)&&!o.bottomPassed,o.passing=o.topPassed&&!o.bottomPassed,o.offScreen=!o.onScreen,o.passing&&(o.pixelsPassed=e.top-o.top,o.percentagePassed=(e.top-o.top)/o.height),v.cache.element=o,v.verbose("Updated element calculations",o),o},screenCalculations:function(){var e=v.get.scroll();return v.save.direction(),v.cache.screen.top=e,v.cache.screen.bottom=e+v.cache.screen.height,v.cache.screen},screenSize:function(){v.verbose("Saving window position"),v.cache.screen={height:f.height()}},position:function(){v.save.screenSize(),v.save.elementPosition()}},get:{pixelsPassed:function(e){var o=v.get.elementCalculations();return-1