# HG changeset patch # User hamidouk # Date 1321629922 -3600 # Node ID ff20c80c684508785b0209a859e3ff1c94fc6b4d # Parent ff416475397ada41c69d7b05aa644fe9544f3a9d added a minimize functionality to the tweetwidget. diff -r ff416475397a -r ff20c80c6845 src/css/LdtPlayer.css --- a/src/css/LdtPlayer.css Fri Nov 18 14:56:38 2011 +0100 +++ b/src/css/LdtPlayer.css Fri Nov 18 16:25:22 2011 +0100 @@ -251,3 +251,6 @@ } + .Ldt-tweetWidgetMinimize { + float: right; + } \ No newline at end of file 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)); }; diff -r ff416475397a -r ff20c80c6845 src/templates/tweetWidget.html --- a/src/templates/tweetWidget.html Fri Nov 18 14:56:38 2011 +0100 +++ b/src/templates/tweetWidget.html Fri Nov 18 16:25:22 2011 +0100 @@ -1,5 +1,6 @@ {{! template for the tweet widget }}
+
Minimize