Fix automatic selection of share link

This commit is contained in:
Neil Lalonde 2013-03-28 16:58:30 -04:00
parent a819a26f34
commit f2d61496af
2 changed files with 8 additions and 2 deletions

View file

@ -23,7 +23,13 @@ Discourse.ShareView = Discourse.View.extend({
linkChanged: (function() {
if (this.present('controller.link')) {
$('#share-link input').val(this.get('controller.link')).select().focus();
var $linkInput = $('#share-link input');
$linkInput.val(this.get('controller.link'));
// Wait for the fade-in transition to finish before selecting the link:
window.setTimeout(function() {
$linkInput.select().focus();
}, 160);
}
}).observes('controller.link'),

View file

@ -12,7 +12,7 @@
background-color: $light_gray;
padding: 3px 7px 6px 7px;
width: 300px;
@include fades-in(0.25s);
@include fades-in(0.15s);
&.visible {
@include visible;
}