Skip to content

Commit

Permalink
v2.0.2
Browse files Browse the repository at this point in the history
Using `getBoundingClientRect()` instead of jQuery `.position()` when
LoadingOverlay is displayed on an element with `position : fixed`
  • Loading branch information
Gaspare Sganga committed Mar 20, 2018
1 parent 4660a66 commit 01539cc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## v2.0.2 - 2018-03-20
### Fixed
- Using `getBoundingClientRect()` instead of jQuery `.position()` when LoadingOverlay is displayed on an element with `position : fixed`



## v2.0.1 - 2018-03-16
### Fixed
- Changed value for overlay `justify-content` CSS property from `space-evenly` to `space-around`: Edge didn't like the former
Expand Down
4 changes: 2 additions & 2 deletions dist/loadingoverlay.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***************************************************************************************************
LoadingOverlay - A flexible loading overlay jQuery plugin
Author : Gaspare Sganga
Version : 2.0.1
Version : 2.0.2
License : MIT
Documentation : https://gasparesganga.com/labs/jquery-loading-overlay/
***************************************************************************************************/
Expand Down Expand Up @@ -374,7 +374,7 @@ LoadingOverlay - A flexible loading overlay jQuery plugin
// Overlay
if (!wholePage) {
var isFixed = container.css("position") === "fixed";
var pos = isFixed ? container.position() : container.offset();
var pos = isFixed ? container[0].getBoundingClientRect() : container.offset();
overlay.css({
"position" : isFixed ? "fixed" : "absolute",
"top" : pos.top + parseInt(container.css("border-top-width"), 10),
Expand Down
4 changes: 2 additions & 2 deletions dist/loadingoverlay.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/loadingoverlay.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gasparesganga-jquery-loading-overlay",
"version": "2.0.1",
"version": "2.0.2",
"description": "A flexible loading overlay jQuery plugin",
"homepage": "https://gasparesganga.com/labs/jquery-loading-overlay/",
"author": "Gaspare Sganga <[email protected]> (https://gasparesganga.com)",
Expand Down
4 changes: 2 additions & 2 deletions src/loadingoverlay.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***************************************************************************************************
LoadingOverlay - A flexible loading overlay jQuery plugin
Author : Gaspare Sganga
Version : 2.0.1
Version : 2.0.2
License : MIT
Documentation : https://gasparesganga.com/labs/jquery-loading-overlay/
***************************************************************************************************/
Expand Down Expand Up @@ -374,7 +374,7 @@ LoadingOverlay - A flexible loading overlay jQuery plugin
// Overlay
if (!wholePage) {
var isFixed = container.css("position") === "fixed";
var pos = isFixed ? container.position() : container.offset();
var pos = isFixed ? container[0].getBoundingClientRect() : container.offset();
overlay.css({
"position" : isFixed ? "fixed" : "absolute",
"top" : pos.top + parseInt(container.css("border-top-width"), 10),
Expand Down

0 comments on commit 01539cc

Please sign in to comment.