summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-11 13:03:09 +0100
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-11 13:50:14 +0100
commitd1211e0ada61896c3a7a02c4fe7138705b086022 (patch)
tree656f1db5028a827d535e2d78165211c457de8bde
parent2029be038b1a7f960f11b51511e081a1a8337d98 (diff)
downloadgitlab-ce-d1211e0ada61896c3a7a02c4fe7138705b086022.tar.gz
Fix award-emojis alert flash message
This adds a new feature to `Flash` that allows to pin it after a specified selector. This removes a fixed position from such award-emoji alert, and makes it responsive by design of selector that this alert is pinned to. Closes #3996
-rw-r--r--app/assets/javascripts/flash.js.coffee4
-rw-r--r--app/assets/javascripts/notes.js.coffee2
-rw-r--r--app/assets/stylesheets/framework/flash.scss10
3 files changed, 3 insertions, 13 deletions
diff --git a/app/assets/javascripts/flash.js.coffee b/app/assets/javascripts/flash.js.coffee
index 9b59d4e57f7..5de012e409f 100644
--- a/app/assets/javascripts/flash.js.coffee
+++ b/app/assets/javascripts/flash.js.coffee
@@ -12,5 +12,5 @@ class @Flash
@flash.click -> $(@).fadeOut()
@flash.show()
- pin: ->
- @flash.addClass('flash-pinned flash-raised')
+ pinTo: (selector) ->
+ @flash.detach().appendTo(selector)
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index b1df56b24fe..a7d720fff4b 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -114,7 +114,7 @@ class @Notes
unless note.valid
if note.award
flash = new Flash('You have already used this award emoji!', 'alert')
- flash.pin()
+ flash.pinTo('.header-content')
return
# render note if it not present in loaded list
diff --git a/app/assets/stylesheets/framework/flash.scss b/app/assets/stylesheets/framework/flash.scss
index 1b723021d76..82eb50ad4be 100644
--- a/app/assets/stylesheets/framework/flash.scss
+++ b/app/assets/stylesheets/framework/flash.scss
@@ -15,13 +15,3 @@
@extend .alert-danger;
}
}
-
-.flash-pinned {
- position: fixed;
- top: 80px;
- width: 80%;
-}
-
-.flash-raised {
- z-index: 1000;
-}