src/js/widgets/tweetsWidget.js
branchpopcorn-port
changeset 378 110311d59b2f
parent 370 2ee4da8122f4
child 541 f7667a1dde8e
equal deleted inserted replaced
377:2dc60fa78c41 378:110311d59b2f
    74 IriSP.TweetsWidget.prototype.closePanel = function() {
    74 IriSP.TweetsWidget.prototype.closePanel = function() {
    75     if (this._timeoutId != undefined) {
    75     if (this._timeoutId != undefined) {
    76       /* we're called from the "close window" link */
    76       /* we're called from the "close window" link */
    77       /* cancel the timeout */
    77       /* cancel the timeout */
    78       window.clearTimeout(this._timeoutId);
    78       window.clearTimeout(this._timeoutId);
       
    79       this._timeoutId = null;
    79     }
    80     }
    80     
    81     
    81     this.selector.hide("blind", 400);
    82     this.selector.hide("blind", 400);
    82     
    83     
       
    84 };
       
    85 
       
    86 /* cancel the timeout if the user clicks on the keep panel open button */
       
    87 IriSP.TweetsWidget.prototype.keepPanel = function() {
       
    88     if (this._timeoutId != undefined) {
       
    89       /* we're called from the "close window" link */
       
    90       /* cancel the timeout */
       
    91       window.clearTimeout(this._timeoutId);
       
    92       this._timeoutId = null;
       
    93     }
    83 };
    94 };
    84 
    95 
    85 IriSP.TweetsWidget.prototype.draw = function() {
    96 IriSP.TweetsWidget.prototype.draw = function() {
    86   var _this = this;
    97   var _this = this;
    87   
    98   
    88   var tweetMarkup = IriSP.templToHTML(IriSP.tweetWidget_template, {"share_template" : IriSP.share_template});
    99   var tweetMarkup = IriSP.templToHTML(IriSP.tweetWidget_template, {"share_template" : IriSP.share_template});
    89   this.selector.append(tweetMarkup);
   100   this.selector.append(tweetMarkup);
    90   this.selector.hide();
   101   this.selector.hide();
    91   this.selector.find(".Ldt-tweetWidgetMinimize").click(IriSP.wrap(this, this.closePanel));
   102   this.selector.find(".Ldt-tweetWidgetMinimize").click(IriSP.wrap(this, this.closePanel));
       
   103   this.selector.find(".Ldt-tweetWidgetKeepOpen").click(IriSP.wrap(this, this.keepPanel));
    92   
   104   
    93   this._Popcorn.listen("IriSP.PolemicTweet.click", IriSP.wrap(this, this.PolemicTweetClickHandler));
   105   this._Popcorn.listen("IriSP.PolemicTweet.click", IriSP.wrap(this, this.PolemicTweetClickHandler));
    94 };
   106 };
    95 
   107 
    96 IriSP.TweetsWidget.prototype.PolemicTweetClickHandler = function(tweet_id) {  
   108 IriSP.TweetsWidget.prototype.PolemicTweetClickHandler = function(tweet_id) {