New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

onbrandutilityfunctions

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onbrandutilityfunctions - npm Package Compare versions

Comparing version

to
1.0.6

2

package.json
{
"name": "onbrandutilityfunctions",
"version": "1.0.5",
"version": "1.0.6",
"description": "A collection of useful reusable functions for working with uberflip hubs, to be included on an as-needed basis.",

@@ -5,0 +5,0 @@ "main": "scripts.js",

@@ -507,1 +507,29 @@ /**

};
/**
* Locks the reco engine panel to the bottom of the provided target, but moves it to the top of the screen
* when the target is out of view.
*
* @param {Selector} target
*/
export function recoEnginePositioning(target) {
const reposition = function(target) {
try {
const $reco = $('.reco-panel');
const bottomOfTarget = $(target).offset().top + $(target).height();
const calculatedPosition = bottomOfTarget - $(window).scrollTop();
const desiredPosition = calculatedPosition > 0 ? calculatedPosition : 0;
$reco.css('top', desiredPosition);
} catch (err) {
console.warn('recoEnginePositioning() has failed - the error thrown was:');
console.error(err);
console.warn('The target used was:' + target);
}
}.bind($('.reco-panel'), target);
Hubs.Events.on('scroll', reposition);
Hubs.Events.on('load', reposition);
Hubs.Events.on('pageChange', reposition);
Hubs.Events.on('resize', reposition);
};