Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@olton/query

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@olton/query - npm Package Compare versions

Comparing version 0.4.17 to 0.4.18

2

package.json
{
"name": "@olton/query",
"version": "0.4.17",
"version": "0.4.18",
"description": "Query is a minimalist JavaScript library for manipulating with HTML Elements",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -5,13 +5,34 @@ import {undef} from "../helpers/undef.js";

export const Position = {
offset: function(){
offset: function(val){
if (this.length === 0) return
const el = this[0]
return {
top: el.offsetTop,
left: el.offsetLeft,
height: el.offsetHeight,
width: el.offsetWidth,
parent: el.offsetParent
if (undef(val)) {
if (this.length === 0) return undefined;
const rect = this[0].getBoundingClientRect();
return {
top: rect.top + scrollY,
left: rect.left + scrollX
};
}
return this.each(function(){ //?
const el = $(this)
let top = val.top, left = val.left
const position = getComputedStyle(this).position
const offset = el.offset();
if (position === "static") {
el.css("position", "relative");
}
if (["absolute", "fixed"].indexOf(position) === -1) {
top = top - offset.top;
left = left - offset.left;
}
el.css({
top: top,
left: left
});
});
},

@@ -18,0 +39,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc