Fix automatic selection of share link
This commit is contained in:
parent
a819a26f34
commit
f2d61496af
|
@ -23,7 +23,13 @@ Discourse.ShareView = Discourse.View.extend({
|
||||||
|
|
||||||
linkChanged: (function() {
|
linkChanged: (function() {
|
||||||
if (this.present('controller.link')) {
|
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'),
|
}).observes('controller.link'),
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
background-color: $light_gray;
|
background-color: $light_gray;
|
||||||
padding: 3px 7px 6px 7px;
|
padding: 3px 7px 6px 7px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
@include fades-in(0.25s);
|
@include fades-in(0.15s);
|
||||||
&.visible {
|
&.visible {
|
||||||
@include visible;
|
@include visible;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue