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

View File

@ -6,16 +6,15 @@
#share-link { #share-link {
position: absolute; position: absolute;
left: 20px; left: 20px;
top: 0;
z-index: 990; z-index: 990;
@include border-radius-all(3px); @include border-radius-all(3px);
@include box-shadow(1px 1px 5px $darkish_gray); @include box-shadow(1px 1px 5px $darkish_gray);
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.15s); display: none;
&.visible { &.visible {
@include visible; display: block;
} }
input[type=text] { input[type=text] {
width: 96%; width: 96%;