glud-component
Advanced tools
Comparing version 0.0.24 to 1.0.0
@@ -97,6 +97,6 @@ 'use strict'; | ||
function createElemetReactAlert(properties) { | ||
document.body.children[0].classList.add('react-alert-message'); | ||
var divTarget = document.createElement('div'); | ||
divTarget.id = 'box-react-alert-message'; | ||
document.body.appendChild(divTarget); | ||
(0, _reactDom.render)(_react2.default.createElement(AlertMessage, properties), divTarget); | ||
@@ -106,13 +106,24 @@ } | ||
function openAlertMessage(properties) { | ||
closeAlertMessage(); | ||
createElemetReactAlert(properties); | ||
closeAlertMessage().then(function () { | ||
createElemetReactAlert(properties); | ||
}); | ||
} | ||
function closeAlertMessage() { | ||
if (document.body.children[0].classList.contains('react-alert-message')) { | ||
return new Promise(function (resolve) { | ||
var target = document.getElementById('box-react-alert-message'); | ||
target.parentNode.removeChild(target); | ||
var root = document.body.children[0]; | ||
root.classList.remove('react-alert-message'); | ||
} | ||
if (!target) resolve(); | ||
target.classList.add('alert-fade-out'); | ||
var remove = function remove() { | ||
target.removeEventListener('webkitAnimationEnd', remove, false); | ||
target.removeEventListener('animationend', remove, false); | ||
target.parentNode.removeChild(target); | ||
resolve(); | ||
}; | ||
target.addEventListener('webkitAnimationEnd', remove, false); | ||
target.addEventListener('onclick', remove, false); | ||
}); | ||
} | ||
@@ -119,0 +130,0 @@ |
@@ -62,6 +62,6 @@ 'use strict'; | ||
function createElemetReactLoading(properties) { | ||
document.body.children[0].classList.add('react-loading'); | ||
var divTarget = document.createElement('div'); | ||
divTarget.id = 'box-react-loading'; | ||
document.body.appendChild(divTarget); | ||
(0, _reactDom.render)(_react2.default.createElement(Loading, properties), divTarget); | ||
@@ -71,13 +71,28 @@ } | ||
function openLoading(properties) { | ||
closeLoading(); | ||
createElemetReactLoading(properties); | ||
closeLoading().then(function () { | ||
createElemetReactLoading(properties); | ||
}); | ||
} | ||
function closeLoading() { | ||
if (document.body.children[0].classList.contains('react-loading')) { | ||
return new Promise(function (resolve) { | ||
var target = document.getElementById('box-react-loading'); | ||
target.parentNode.removeChild(target); | ||
var root = document.body.children[0]; | ||
root.classList.remove('react-loading'); | ||
} | ||
if (!target) resolve(); | ||
target.classList.add('loading-fade-out'); | ||
var remove = function remove() { | ||
// target.removeEventListener('webkitAnimationEnd', remove, false) | ||
// target.removeEventListener('animationend', remove, false) | ||
target.parentNode.removeChild(target); | ||
var targetOther = document.getElementById('box-react-loading'); | ||
if (!targetOther) resolve(); | ||
closeLoading(); | ||
}; | ||
remove(); | ||
// target.addEventListener('webkitAnimationEnd', remove, false) | ||
// target.addEventListener('onclick', remove, false) | ||
}); | ||
} | ||
@@ -84,0 +99,0 @@ |
{ | ||
"name": "glud-component", | ||
"version": "0.0.24", | ||
"version": "1.0.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1446968
5187
1