summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-02-02 11:45:58 -0600
committerMike Greiling <mike@pixelcog.com>2017-02-02 11:45:58 -0600
commit7ca57c59c8b29dfbf714b9921583f3544c76bdb3 (patch)
tree52a5cca34c203d5a311e923cc5a474c1a42bf509 /app/assets/javascripts/lib
parent5a099315eb29c345925141609dc5a3a395312016 (diff)
parent4615d0995117e8369acc7b1f5f2b8497426ba5c7 (diff)
downloadgitlab-ce-7ca57c59c8b29dfbf714b9921583f3544c76bdb3.tar.gz
Merge branch 'master' into webpack
* master: (63 commits) Use `add_$role` helper in snippets specs removes old css class from everywhere Fixes broken build: Use jquery to get the element position in the page Check public snippets for spam Keep snippet visibility on error Update pipeline and commit URL and text on CI status change Support non-ASCII characters in GFM autocomplete Active tense test coverage Fix filtered search manager spec teaspoon error Reduce the number of loops that Cycle Analytics specs use Remove unnecessary returns / unset variables from the CoffeeScript -> JS conversion. update spec Change the reply shortcut to focus the field even without a selection. use destroy_all Remove settings cog from within admin scroll tabs; keep links centered add changelog remove old project members from project add spec replicating validation error Improve styling of the new issue message Don't capitalize environment name in show page ...
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js.es61
1 files changed, 1 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js.es6 b/app/assets/javascripts/lib/utils/common_utils.js.es6
index 51993bb3420..e3bff2559fd 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js.es6
+++ b/app/assets/javascripts/lib/utils/common_utils.js.es6
@@ -162,6 +162,7 @@
w.gl.utils.getSelectedFragment = () => {
const selection = window.getSelection();
+ if (selection.rangeCount === 0) return null;
const documentFragment = selection.getRangeAt(0).cloneContents();
if (documentFragment.textContent.length === 0) return null;