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.2 to 2.6.3

2

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

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

@@ -14,3 +14,3 @@ # vue-scrollto

For `vue 1.x` use `v...` but keep in mind that the old version depends on `jquery`.
For `vue 1.x` use `vue-scrollTo@1.0.1` (note the capital T) but keep in mind that the old version depends on `jquery`.

@@ -48,3 +48,3 @@ ## Under the hood

<script src="https://unpkg.com/vue@2.2.4"></script>
<script src="https://unpkg.com/vue-scrollto@2.6.0"></script>
<script src="https://unpkg.com/vue-scrollto"></script>
```

@@ -51,0 +51,0 @@ <p class="tip">

import scrollTo from "./scrollTo";
import _ from "./utils";
const bindings = {}; // store binding data
function handleClick(e) {
e.preventDefault();
let ctx = bindings[this];
if (typeof this.value === "string") {
return scrollTo(this.value);
if (typeof ctx.value === "string") {
return scrollTo(ctx.value);
}
scrollTo(this.value.el || this.value.element, this.value);
scrollTo(ctx.value.el || ctx.value.element, ctx.value);
}

@@ -15,8 +18,13 @@

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

@@ -280,9 +280,12 @@ (function (global, factory) {

var bindings = {}; // store binding data
function handleClick(e) {
e.preventDefault();
var ctx = bindings[this];
if (typeof this.value === "string") {
return _scroller(this.value);
if (typeof ctx.value === "string") {
return _scroller(ctx.value);
}
_scroller(this.value.el || this.value.element, this.value);
_scroller(ctx.value.el || ctx.value.element, ctx.value);
}

@@ -292,7 +295,12 @@

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

@@ -299,0 +307,0 @@ scrollTo: _scroller

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