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

vue-scrollto

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-scrollto - npm Package Compare versions

Comparing version 2.6.3 to 2.6.4

2

package.json
{
"name": "vue-scrollto",
"version": "2.6.3",
"version": "2.6.4",
"description": "Adds a directive that listens for click events and scrolls to elements.",

@@ -5,0 +5,0 @@ "main": "vue-scrollto.js",

import scrollTo from "./scrollTo";
import _ from "./utils";
const bindings = {}; // store binding data
let bindings = []; // store binding data
function deleteBinding(el) {
for (let i = 0; i < bindings.length; ++i) {
if (bindings[i].el === el) {
bindings.splice(i, 1);
return true;
}
}
return false;
}
function getBinding(el) {
let binding = bindings.find(entry => {
return entry.el == el;
});
if (binding) {
return binding;
}
bindings.push(
binding = {
el: el,
binding: {}
}
);
return binding;
}
function handleClick(e) {
e.preventDefault();
let ctx = bindings[this];
let ctx = getBinding(this).binding;

@@ -18,13 +47,14 @@ if (typeof ctx.value === "string") {

bind(el, binding) {
bindings[el] = binding;
getBinding(el).binding = binding;
_.on(el, "click", handleClick);
},
unbind(el) {
delete bindings[el];
deleteBinding(el);
_.off(el, "click", handleClick);
},
update(el, binding) {
bindings[el] = binding;
getBinding(el).binding = binding;
},
scrollTo
scrollTo,
bindings
};

@@ -280,7 +280,34 @@ (function (global, factory) {

var bindings = {}; // store binding data
var bindings = []; // store binding data
function deleteBinding(el) {
for (var i = 0; i < bindings.length; ++i) {
if (bindings[i].el === el) {
bindings.splice(i, 1);
return true;
}
}
return false;
}
function getBinding(el) {
var binding = bindings.find(function (entry) {
return entry.el == el;
});
if (binding) {
return binding;
}
bindings.push(binding = {
el: el,
binding: {}
});
return binding;
}
function handleClick(e) {
e.preventDefault();
var ctx = bindings[this];
var ctx = getBinding(this).binding;

@@ -295,14 +322,15 @@ if (typeof ctx.value === "string") {

bind: function bind(el, binding) {
bindings[el] = binding;
getBinding(el).binding = binding;
_.on(el, "click", handleClick);
},
unbind: function unbind(el) {
delete bindings[el];
deleteBinding(el);
_.off(el, "click", handleClick);
},
update: function update(el, binding) {
bindings[el] = binding;
getBinding(el).binding = binding;
},
scrollTo: _scroller
scrollTo: _scroller,
bindings: bindings
};

@@ -309,0 +337,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