mobile-viewport-control
Advanced tools
Comparing version 0.1.0 to 0.1.1
# 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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24045
228