Skip to content

Commit

Permalink
have generated short url autofocus for ease of copying t:10m
Browse files Browse the repository at this point in the history
  • Loading branch information
Will McNeilly committed Sep 19, 2011
1 parent f1d3056 commit 8c7926c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/links/_short_url.html.erb
Original file line number Diff line number Diff line change
@@ -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>


3 changes: 2 additions & 1 deletion app/views/links/create.js.erb
Original file line number Diff line number Diff line change
@@ -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.