summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorDmitry Medvinsky <me@dmedvinsky.name>2014-10-31 13:56:35 +0300
committerDmitry Medvinsky <me@dmedvinsky.name>2015-04-17 10:16:18 +0300
commit92544df8da414d506d56b12a6f7077d6abc1e80b (patch)
tree7ef277a5853a16594993fa728c6083c6f1baea9f /app/assets
parentf71a4b145a454f33b9e6bec08e698426eb4a4994 (diff)
downloadgitlab-ce-92544df8da414d506d56b12a6f7077d6abc1e80b.tar.gz
Fix auto-selection of URL field with X11 selection
We use `focusin` event instead of `click` because when using the latter, when the selection is created it isn't put into X11 PRIMARY selection. And as a Linux user I'm very used to such behaviour that when something gets selected, it's ready for pasting, which is the primary purpose of the clone URL field. When `focusin` is used, the selection is copied to X11 buffer automatically, so it works as expected (tested in Firefox and Chrome).
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/application.js.coffee4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index fda142293bc..bd52d3d4d70 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -115,8 +115,8 @@ if location.hash
window.addEventListener "hashchange", shiftWindow
$ ->
- # Click a .one_click_select field, select the contents
- $(".one_click_select").on 'click', -> $(@).select()
+ # Click a .js-select-on-focus field, select the contents
+ $(".js-select-on-focus").on "focusin", -> $(this).select()
$('.remove-row').bind 'ajax:success', ->
$(this).closest('li').fadeOut()