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
This commit is contained in:
parent
2029be038b
commit
d1211e0ada
3 changed files with 3 additions and 13 deletions
|
@ -12,5 +12,5 @@ class @Flash
|
|||
@flash.click -> $(@).fadeOut()
|
||||
@flash.show()
|
||||
|
||||
pin: ->
|
||||
@flash.addClass('flash-pinned flash-raised')
|
||||
pinTo: (selector) ->
|
||||
@flash.detach().appendTo(selector)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -15,13 +15,3 @@
|
|||
@extend .alert-danger;
|
||||
}
|
||||
}
|
||||
|
||||
.flash-pinned {
|
||||
position: fixed;
|
||||
top: 80px;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.flash-raised {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue