strip out css fade-in animation from share dialog, it was only causing trouble. Fixing it is more hassle than it is worth. inivisible elements take height so we constantly need to worry about re-positioning the hidden share dialog.

This commit is contained in:
Sam 2013-08-26 16:28:42 +10:00
parent 0b74c2da9c
commit fd6e86483f
2 changed files with 3 additions and 6 deletions

View file

@ -30,18 +30,16 @@ Discourse.ShareView = Discourse.View.extend({
window.setTimeout(function() {
$linkInput.select().focus();
}, 160);
} else {
$('#share-link').css('top', 0);
}
}.observes('controller.link'),
didInsertElement: function() {
var shareView = this;
$('html').on('mousedown.outside-share-link', function(e) {
// Use mousedown instead of click so this event is handled before routing occurs when a
// link is clicked (which is a click event) while the share dialog is showing.
if (shareView.$().has(e.target).length !== 0) { return; }
shareView.get('controller').close();
return true;
});

View file

@ -6,16 +6,15 @@
#share-link {
position: absolute;
left: 20px;
top: 0;
z-index: 990;
@include border-radius-all(3px);
@include box-shadow(1px 1px 5px $darkish_gray);
background-color: $light_gray;
padding: 3px 7px 6px 7px;
width: 300px;
@include fades-in(0.15s);
display: none;
&.visible {
@include visible;
display: block;
}
input[type=text] {
width: 96%;