diff options
author | Phil Hughes <me@iamphill.com> | 2016-07-05 11:54:49 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-07-05 11:54:49 +0100 |
commit | bf5d28ea8d10c41b80a80c825526400aa3edfa15 (patch) | |
tree | bad53da6f1e61e58576c9811604f4e3048de12e3 | |
parent | ba9ef7f3935cfaa42fcdb2317567cc383c7e9c22 (diff) | |
download | gitlab-ce-ff-markdown-buttons-fix.tar.gz |
Fixed markdown buttons in FFff-markdown-buttons-fix
-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") |