Permalink
Browse files

have generated short url autofocus for ease of copying t:10m

  • Loading branch information...
1 parent f1d3056 commit 8c7926cdf191640870ea01c53b6be549ed2de254 Will McNeilly committed Sep 19, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −1 app/views/links/_short_url.html.erb
  2. +2 −1 app/views/links/create.js.erb
@@ -1,6 +1,6 @@
<div class="short-link-container">
<label>Squished</label>
- <input type="text" onclick="this.focus();this.select()" readonly="readonly" value="<%= "#{short_url(@link)}" %>"/>
+ <input type="text" readonly="readonly" value="<%= "#{short_url(@link)}" %>"/>
</div>
@@ -1,3 +1,4 @@
$('.short-link-container').remove();
$('#new_link').after("<%= escape_javascript(render(:partial => "short_url")) %>");
-$('.link-table').prepend("<%= escape_javascript(render(:partial => "link", :locals => { :link => @link })) %>");
+$('.link-table').prepend("<%= escape_javascript(render(:partial => "link", :locals => { :link => @link })) %>");
+$('.short-link-container input').focus().select();

0 comments on commit 8c7926c

Please sign in to comment.