jquery-popup-overlay
Advanced tools
Comparing version 2.1.0 to 2.1.1
{ | ||
"baseUrl": "http://localhost:8080", | ||
"video": false | ||
"baseUrl": "http://localhost:8080", | ||
"video": false, | ||
"projectId": "of5t69" | ||
} |
@@ -21,3 +21,2 @@ /*! | ||
var iOS = /(iPad|iPhone|iPod)/.test(navigator.userAgent); | ||
var android = /(android)/i.test(navigator.userAgent); | ||
var focusableElementsString = "a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]"; | ||
@@ -121,3 +120,3 @@ | ||
if (options.type == 'overlay' && !options.absolute) { | ||
if (options.type == 'overlay' && !options.absolute && options.background) { | ||
$wrapper.css('overflow','auto'); | ||
@@ -253,3 +252,2 @@ $wrapper[0].style.WebkitOverflowScrolling = 'touch'; // for smooth scrolling in overflow:auto divs in iOS | ||
var $background = $('#' + el.id + '_background'); | ||
var mustLock = false; | ||
@@ -314,14 +312,2 @@ // `beforeopen` callback event | ||
if (!options.background) { | ||
$wrapper.css({ 'pointer-events': 'none' }); | ||
// Android doesn't want to scroll the popup wrapper (i.e. to react to a swipe event) if it has a combination of | ||
// `options.background` set to false, `pointer-events:none` and `position:fixed` on a popup wrapper, plus | ||
// `overflow:visible` on body. If a scrollbar appears on the popup wrapper (i.e.popup is not fully in viewport), | ||
// we locking the scrolling of background content regardless of custom options. | ||
if (android && !options.absolute && !options.scrolllock && !isInViewport(el)) { | ||
mustLock = true; | ||
} | ||
} | ||
opentimer = setTimeout(function() { | ||
@@ -338,3 +324,3 @@ $wrapper.css({ | ||
// Disable background layer scrolling when popup is opened | ||
if (options.scrolllock || mustLock) { | ||
if (options.scrolllock) { | ||
$body.css('overflow', 'hidden'); | ||
@@ -645,2 +631,13 @@ if ($body.height() > $window.height()) { | ||
} | ||
if (!options.background) { | ||
$wrapper.css({ 'pointer-events': 'none' }); | ||
// If popup doesnt fit the viewport, and if background doesn't exist, add scrollbar to popup div instead of wrapper | ||
if (!options.absolute && !isInViewport(el)) { | ||
$el.css('overflow', 'auto'); | ||
$el[0].style.WebkitOverflowScrolling = 'touch'; // for smooth scrolling in overflow:auto divs in iOS | ||
$el.css('max-height', 'calc(100% - ' + $el.css('margin-top') + ' - ' + $el.css('margin-bottom') + ')'); | ||
} | ||
} | ||
} | ||
@@ -647,0 +644,0 @@ }, |
{ | ||
"name": "jquery-popup-overlay", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Lightweight modal popup overlay for jquery", | ||
@@ -35,4 +35,5 @@ "main": "index.js", | ||
"http-server": "^0.11.1", | ||
"pre-commit": "^1.2.2", | ||
"start-server-and-test": "^1.0.1" | ||
} | ||
} |
# jQuery Popup Overlay | ||
jQuery plugin for responsive and accessible modal windows and tooltips. | ||
jQuery plugin for responsive and accessible modal windows and tooltips | ||
@@ -13,2 +13,2 @@ [![NPM version](https://img.shields.io/npm/v/jquery-popup-overlay.svg?style=flat)](https://www.npmjs.com/package/jquery-popup-overlay) | ||
## License | ||
Released under the [MIT license](https://github.com/vast-engineering/jquery-popup-overlay/blob/gh-pages/LICENSE). © 2013 Vast.com, Inc. | ||
Released under the [MIT license](https://github.com/vast-engineering/jquery-popup-overlay/blob/gh-pages/LICENSE). |
Sorry, the diff of this file is not supported yet
123782
5
1442