diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-07-05 23:42:03 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-07-05 23:42:03 +0300 |
commit | 4dda6def95f82979c6ebe4881574a9dc1ce4f1c7 (patch) | |
tree | 35340abc1113ec00ceb57816dca701b3f82b0b89 /app | |
parent | aa974ed5bc6fd2363a4731fe928f411c3a03fedf (diff) | |
parent | bf5d28ea8d10c41b80a80c825526400aa3edfa15 (diff) |
Merge branch 'ff-markdown-buttons-fix' into 'master'
Fixed markdown buttons in FF
## What does this MR do?
The markdown buttons weren't working with the `execCommand` function. So it has to fallback to replacing the value in the textarea.
See merge request !5085
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/lib/utils/text_utility.js.coffee | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js.coffee b/app/assets/javascripts/lib/utils/text_utility.js.coffee index 7bcb876d056..2e1407f8738 100644 --- a/app/assets/javascripts/lib/utils/text_utility.js.coffee +++ b/app/assets/javascripts/lib/utils/text_utility.js.coffee @@ -49,8 +49,9 @@ insertText = "#{startChar}#{tag}#{selected}#{if wrap then tag else ' '}" if document.queryCommandSupported('insertText') - document.execCommand 'insertText', false, insertText - else + inserted = document.execCommand 'insertText', false, insertText + + unless inserted try document.execCommand("ms-beginUndoUnit") |