Skip to content

Commit

Permalink
v2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaspare Sganga committed Jul 3, 2018
1 parent ecd7bfb commit dd80239
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 25 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## v2.1.5 - 2018-07-03
### Fixed
- Toggle LoadingOverlay visibility according to target element
- Clear orphaned intervals when target element is arbitrary removed from DOM



## v2.1.4 - 2018-06-07
### Fixed
- Replaced the `.load()` method with a custom `ajax()` request to load external SVG images in order to prevent conflicts with `ajaxStart()` and `ajaxSend()` event handlers
Expand Down
38 changes: 23 additions & 15 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.1.4
Version : 2.1.5
License : MIT
Documentation : https://gasparesganga.com/labs/jquery-loading-overlay/
***************************************************************************************************/
Expand Down Expand Up @@ -217,8 +217,8 @@ LoadingOverlay - A flexible loading overlay jQuery plugin
settings.minSize = parseInt(settings.minSize, 10) || 0;
settings.resizeInterval = parseInt(settings.resizeInterval, 10) || 0;

var overlay = container.data("loadingoverlay");
var data = _GetData(overlay);
var overlay = _GetOverlay(container);
var data = _GetData(container);
if (data === false) {
// Init data
data = $.extend({}, _dataTemplate);
Expand Down Expand Up @@ -407,8 +407,8 @@ LoadingOverlay - A flexible loading overlay jQuery plugin

function Hide(container, force){
container = $(container);
var overlay = container.data("loadingoverlay");
var data = _GetData(overlay);
var overlay = _GetOverlay(container);
var data = _GetData(container);
if (data === false) return;

data.count--;
Expand All @@ -427,8 +427,7 @@ LoadingOverlay - A flexible loading overlay jQuery plugin

function Text(container, value){
container = $(container);
var overlay = container.data("loadingoverlay");
var data = _GetData(overlay);
var data = _GetData(container);
if (data === false || !data.text) return;

if (value === false) {
Expand All @@ -442,8 +441,7 @@ LoadingOverlay - A flexible loading overlay jQuery plugin

function Progress(container, value){
container = $(container);
var overlay = container.data("loadingoverlay");
var data = _GetData(overlay);
var data = _GetData(container);
if (data === false || !data.progress) return;

if (value === false) {
Expand All @@ -462,8 +460,8 @@ LoadingOverlay - A flexible loading overlay jQuery plugin


function _IntervalResize(container, force){
var overlay = container.data("loadingoverlay");
var data = _GetData(overlay);
var overlay = _GetOverlay(container);
var data = _GetData(container);
if (data === false) return;

// Overlay
Expand Down Expand Up @@ -517,16 +515,26 @@ LoadingOverlay - A flexible loading overlay jQuery plugin
}


function _GetData(overlay){
var data = (typeof overlay === "undefined") ? undefined : overlay.data("loadingoverlay_data");
function _GetOverlay(container){
return container.data("loadingoverlay");
}

function _GetData(container){
var overlay = _GetOverlay(container);
var data = (typeof overlay === "undefined") ? undefined : overlay.data("loadingoverlay_data");
if (typeof data === "undefined") {
// Clean DOM
$(".loadingoverlay").each(function(){
var $this = $(this);
if (!document.body.contains($this.data("loadingoverlay_data").container[0])) $this.remove();
var $this = $(this);
var data = $this.data("loadingoverlay_data");
if (!document.body.contains(data.container[0])) {
if (data.resizeIntervalId) clearInterval(data.resizeIntervalId);
$this.remove();
}
});
return false;
} else {
overlay.toggle(container.is(":visible"));
return data;
}
}
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.

8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gasparesganga-jquery-loading-overlay",
"version": "2.1.4",
"version": "2.1.5",
"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 Expand Up @@ -28,7 +28,7 @@
"del": "^3.0.0",
"gulp": "^4.0.0",
"gulp-header": "^2.0.5",
"gulp-rename": "^1.2.3",
"gulp-rename": "^1.3.0",
"gulp-replace": "^0.6.1",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion 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.1.5dev
Version : 2.1.5
License : MIT
Documentation : https://gasparesganga.com/labs/jquery-loading-overlay/
***************************************************************************************************/
Expand Down

0 comments on commit dd80239

Please sign in to comment.