Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2019-09-03 12:03:35 +0300
committerKushal Pandya <kushalspandya@gmail.com>2019-09-03 12:03:35 +0300
commit3741402a241df2ad6ab28e4b76edafe5083ce733 (patch)
tree90c67bb90414724df6559cf1d2e6f22d4b3aa035 /app/assets/javascripts/flash.js
parentaf5f2424cace62f8712dbabfd60bb0f1c36f1590 (diff)
Make flash notifications sticky
This commit also unifies layout structure and remove no_container flag
Diffstat (limited to 'app/assets/javascripts/flash.js')
-rw-r--r--app/assets/javascripts/flash.js21
1 files changed, 6 insertions, 15 deletions
diff --git a/app/assets/javascripts/flash.js b/app/assets/javascripts/flash.js
index c2397842125..660f0f0ba3e 100644
--- a/app/assets/javascripts/flash.js
+++ b/app/assets/javascripts/flash.js
@@ -1,4 +1,5 @@
import _ from 'underscore';
+import { spriteIcon } from './lib/utils/common_utils';
const hideFlash = (flashEl, fadeTransition = true) => {
if (fadeTransition) {
@@ -35,16 +36,11 @@ const createAction = config => `
</a>
`;
-const createFlashEl = (message, type, isFixedLayout = false) => `
- <div
- class="flash-${type}"
- >
- <div
- class="flash-text ${
- isFixedLayout ? 'container-fluid container-limited limit-container-width' : ''
- }"
- >
+const createFlashEl = (message, type) => `
+ <div class="flash-content flash-${type} rounded">
+ <div class="flash-text">
${_.escape(message)}
+ ${spriteIcon('close', 'close-icon')}
</div>
</div>
`;
@@ -76,15 +72,10 @@ const createFlash = function createFlash(
addBodyClass = false,
) {
const flashContainer = parent.querySelector('.flash-container');
- const navigation = parent.querySelector('.content');
if (!flashContainer) return null;
- const isFixedLayout = navigation
- ? navigation.parentNode.classList.contains('container-limited')
- : true;
-
- flashContainer.innerHTML = createFlashEl(message, type, isFixedLayout);
+ flashContainer.innerHTML = createFlashEl(message, type);
const flashEl = flashContainer.querySelector(`.flash-${type}`);
removeFlashClickListener(flashEl, fadeTransition);