summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/flash.js
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2018-01-19 09:38:34 +0000
committerPhil Hughes <me@iamphill.com>2018-01-19 09:38:34 +0000
commite79db43d2cf269beec700353e776e92b15ac9af9 (patch)
tree5e4a6ab9b4843c58288c670d5eabe7ff2f31fee1 /app/assets/javascripts/flash.js
parentdd633dc48f00f779755370e3849691dc776b5055 (diff)
downloadgitlab-ce-e79db43d2cf269beec700353e776e92b15ac9af9.tar.gz
WebIDE: Fix Commit bugs
Diffstat (limited to 'app/assets/javascripts/flash.js')
-rw-r--r--app/assets/javascripts/flash.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/flash.js b/app/assets/javascripts/flash.js
index 44deab9288e..a0af2875ab5 100644
--- a/app/assets/javascripts/flash.js
+++ b/app/assets/javascripts/flash.js
@@ -10,6 +10,7 @@ const hideFlash = (flashEl, fadeTransition = true) => {
flashEl.addEventListener('transitionend', () => {
flashEl.remove();
+ if (document.body.classList.contains('flash-shown')) document.body.classList.remove('flash-shown');
}, {
once: true,
passive: true,
@@ -64,6 +65,7 @@ const createFlash = function createFlash(
parent = document,
actionConfig = null,
fadeTransition = true,
+ addBodyClass = false,
) {
const flashContainer = parent.querySelector('.flash-container');
@@ -86,6 +88,8 @@ const createFlash = function createFlash(
flashContainer.style.display = 'block';
+ if (addBodyClass) document.body.classList.add('flash-shown');
+
return flashContainer;
};