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

autoroute.js

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoroute.js - npm Package Compare versions

Comparing version 1.0.23 to 1.0.24

43

autoroute.js

@@ -7,3 +7,3 @@ import Touch from 'hammerjs'

routes : {},
t : { link : [], back : [] }
t : { link : [], back : [], tap : [] }
}

@@ -16,3 +16,3 @@

e.className = 'route hide'
e.className = 'route scroll hide'
e.slide = false

@@ -61,9 +61,11 @@ e.q = {}

route.t.link.destroy ? route.t.link.forEach( e => e.destroy() ) :
route.t.back.destroy ? route.t.back.forEach( e => e.destroy() ) :
route.t = { link : [], back : [] }
if ( route.t.link[0] ) {
route.t.link.forEach( e => e.destroy() )
route.t.back.forEach( e => e.destroy() )
route.t.tap.forEach( e => e.destroy() )
}
el('[link]', (el, i) => {
route.t.link[i] = new Touch(el, { touchAction: 'pan-x pan-y' })
route.t.link[i] = new Touch.Manager(el)
route.t.link[i].add(new Touch.Tap())
route.t.link[i].on('tap', ev => {

@@ -73,4 +75,4 @@

if ( !window.location.hash.split('?')[1] ) {
document.querySelectorAll('.active')[0].classList.remove('active')
if (ev.target.offsetParent.tagName == 'FOOTER') {
document.querySelectorAll('footer .active')[0].classList.remove('active')
ev.target.classList.add('active')

@@ -83,5 +85,18 @@ }

el('[back]', (el, i) => {
route.t.back[i] = new Touch(el, { touchAction: 'pan-x pan-y' })
route.t.back[i] = new Touch.Manager(el)
route.t.back[i].add(new Touch.Tap())
route.t.back[i].on('tap', () => history.go(-1) )
})
el('[ontap]', (el, i) => {
route.t.tap[i] = new Touch.Manager(el)
route.t.tap[i].add(new Touch.Tap())
route.t.tap[i].on('tap', ev => {
var fn = () => eval(ev.target.getAttribute('ontap'))
fn.call(route.routes[window.location.hash.split('#/')[1]])
})
})
}

@@ -100,3 +115,2 @@

!e ? fn(form) : console.log('Your form inputs are generating some errors.')
})

@@ -208,4 +222,2 @@ }

height: ${ r };
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
background-color: #fafafa;

@@ -217,2 +229,7 @@ animation-duration: 0.3s;

.scroll {
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
.hide {

@@ -219,0 +236,0 @@ display : none

{
"name": "autoroute.js",
"version": "1.0.23",
"version": "1.0.24",
"description": "Another lightweight javascript routing framework ",

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

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