diff -r ff416475397a -r ff20c80c6845 src/js/widgets/tweetsWidget.js --- a/src/js/widgets/tweetsWidget.js Fri Nov 18 14:56:38 2011 +0100 +++ b/src/js/widgets/tweetsWidget.js Fri Nov 18 16:25:22 2011 +0100 @@ -4,7 +4,7 @@ IriSP.Widget.call(this, Popcorn, config, Serializer); this._displayingTweet = false; - this._timeoutId = undefined; + this._timeoutId = undefined; }; @@ -24,7 +24,7 @@ this.selector.find(".Ldt-tweetContents").text(title); this.selector.find(".Ldt-tweetAvatar").html(imageMarkup); - this.selector.show(50); + this.selector.show("blind", 250); }; IriSP.TweetsWidget.prototype.displayTweet = function(annotation) { @@ -43,15 +43,20 @@ IriSP.TweetsWidget.prototype.clearPanel = function() { this._displayingTweet = false; + this._timeoutId = undefined; this.closePanel(); + }; IriSP.TweetsWidget.prototype.closePanel = function() { - if (this._displayingTweet) - return; - else { - this.selector.hide(50); - } + if (this._timeoutId != undefined) { + /* we're called from the "close window" link */ + /* cancel the timeout */ + window.clearTimeout(this._timeoutId); + } + + this.selector.hide("blind", 400); + }; IriSP.TweetsWidget.prototype.draw = function() { @@ -60,6 +65,7 @@ var tweetMarkup = Mustache.to_html(IriSP.tweetWidget_template, {"share_template" : IriSP.share_template}); this.selector.append(tweetMarkup); this.selector.hide(); + this.selector.find(".Ldt-tweetWidgetMinimize").click(IriSP.wrap(this, this.closePanel)); this._Popcorn.listen("IriSP.PolemicTweet.click", IriSP.wrap(this, this.PolemicTweetClickHandler)); };