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

mobile-viewport-control

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobile-viewport-control - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

5

CHANGES.md
# Changes
## 0.1.1
- restore specified viewport width on thaw
- export `getInitialViewport`
## 0.1.0
- initial release

22

index.js
//
// Mobile Viewport Control v0.1.0
// Mobile Viewport Control v0.1.1
//

@@ -125,3 +125,3 @@ // Copyright (c) 2016 Shaun Williams

// was before freezing.
function thaw(onDone, extras) {
function thaw(onDone, testEvts) {
var hook = document.getElementById(hookID);

@@ -142,7 +142,8 @@ if (!hook) {

setTimeout(function() {
if (extras.onRestoreScale)
extras.onRestoreScale();
if (testEvts && testEvts.onRestoreScale)
testEvts.onRestoreScale();
// Restore the page's zoom bounds.
hook.setAttribute('content', [
(initial.width ? ('width=' + initial.width) : null),
'user-scalable='+initial['user-scalable'],

@@ -152,7 +153,7 @@ 'initial-scale='+originalScale,

'maximum-scale='+initial['maximum-scale']
].join(','));
].filter(Boolean).join(','));
setTimeout(function(){
if (extras.onRestoreBounds)
extras.onRestoreBounds();
if (testEvts && testEvts.onRestoreBounds)
testEvts.onRestoreBounds();

@@ -166,4 +167,4 @@ // Remove our meta viewport hook.

if (extras.onRestoreScroll)
extras.onRestoreScroll();
if (testEvts && testEvts.onRestoreScroll)
testEvts.onRestoreScroll();

@@ -178,3 +179,4 @@ if (onDone)

return {
version: '0.1.0',
version: '0.1.1',
getInitialViewport: getInitialViewport,
getScale: getScale,

@@ -181,0 +183,0 @@ freeze: freeze,

{
"name": "mobile-viewport-control",
"version": "0.1.0",
"version": "0.1.1",
"description": "Dynamically control the mobile viewport",

@@ -5,0 +5,0 @@ "main": "index.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