diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-07-11 21:04:43 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-07-11 21:04:43 +0000 |
commit | f76596380fb545c54b14c6bfc339a68a1dc162d3 (patch) | |
tree | 7b584be877ab25e884ff5502888d2637dd8720e5 /app/assets/javascripts/notes.js.coffee | |
parent | edc2792557d143aab09966e37f1ac694fb24796d (diff) | |
parent | 2886ebfb135e00ce9cc77914155d5974e14fed18 (diff) | |
download | gitlab-ce-f76596380fb545c54b14c6bfc339a68a1dc162d3.tar.gz |
Merge branch 'remove-pinto-from-flash' into 'master'
Remove pinTo from Flash
## What does this MR do?
- replace `pinTo` of `Flash` by `parent` parameter in constructor
- move positioning of layout containers from CoffeeScript to layout files
- adjust styling of inline flash messages
## Are there points in the code the reviewer needs to double check?
- display of flash messages in general
## Why was this MR needed?
- allow finding and positioning flash message containers within layout files
- allow adding different CSS classes to flash containers within layout files (necessary for fixing #18908)
- allow multiple flash messages to be displayed at different places at the same time
- make inline flash messages look nicer
## What are the relevant issue numbers?
closes #18908, closes part of #18897
## Screenshots
### Inline flash message (before)


### Inline flash message (after)


### Other flash messages (after)

---

---

---

---

---

---
### This is possible now

See merge request !4854
Diffstat (limited to 'app/assets/javascripts/notes.js.coffee')
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 0b7d8f64456..0ea54faae1a 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -194,8 +194,7 @@ class @Notes renderNote: (note) -> unless note.valid if note.award - flash = new Flash('You have already awarded this emoji!', 'alert') - flash.pinTo('.header-content') + new Flash('You have already awarded this emoji!', 'alert') return if note.award @@ -325,6 +324,8 @@ class @Notes form.find("#note_position").remove() form.find("#note_type").remove() + @parentTimeline = form.parents('.timeline') + ### General note form setup. @@ -357,8 +358,7 @@ class @Notes @renderNote(note) addNoteError: (xhr, note, status) => - flash = new Flash('Your comment could not be submitted! Please check your network connection and try again.', 'alert') - flash.pinTo('.md-area') + new Flash('Your comment could not be submitted! Please check your network connection and try again.', 'alert', @parentTimeline) ### Called in response to the new note form being submitted |