Skip to content

Commit

Permalink
Make the buttons at the top right invisible for every tweet except th…
Browse files Browse the repository at this point in the history
…e one the cursor is in.
  • Loading branch information
drdrang committed Feb 23, 2012
1 parent b3cb3f1 commit 94b46cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions style.css
Expand Up @@ -122,3 +122,7 @@ span.c18th {
font-family: 'IM Fell English', 'Lucida Grande'; font-family: 'IM Fell English', 'Lucida Grande';
font-size: 19px; font-size: 19px;
} }

.invisible {
visibility: hidden;
}
20 changes: 16 additions & 4 deletions twoot.js
Expand Up @@ -248,7 +248,8 @@ $.fn.gettweets = function(){
'<a class="time" title="' + theTime + '" ' + '<a class="time" title="' + theTime + '" ' +
'href="http://twitter.com/' + theScreenName + '/statuses/' + 'href="http://twitter.com/' + theScreenName + '/statuses/' +
theID +'">' + theID +'">' +
relative_time(theTime) + '</a> '+ relative_time(theTime) + '</a> ' +
'<span class="buttons">' +
'<a class="delete" title="Delete" ' + '<a class="delete" title="Delete" ' +
'href="javascript:deleteTweet(\'' + theID + '\')">&#9003;</a>' + 'href="javascript:deleteTweet(\'' + theID + '\')">&#9003;</a>' +
'<a class="retweet" title="Retweet" ' + '<a class="retweet" title="Retweet" ' +
Expand All @@ -267,11 +268,12 @@ $.fn.gettweets = function(){
'href="javascript:replyTo(\'' + theID + 'href="javascript:replyTo(\'' + theID +
'\', \'@' + theScreenName + '\', \'@' + theScreenName +
'\')">@</a>' + '\')">@</a>' +
'</span>' +
'<div class="tweet_text">' + tweet_span_start + '<div class="tweet_text">' + tweet_span_start +
htmlify(theText, theEntities) + tweet_span_end + htmlify(theText, theEntities) + tweet_span_end +
'<span class="info">' + ' from ' + theSource + inReplyText + retweetText + '</span>' + '<span class="info">' + ' from ' + theSource + inReplyText + retweetText + '</span>' +
'</div></li>'); '</div></li>');

// Mark if it's a favorite. // Mark if it's a favorite.
if (item.favorited) { if (item.favorited) {
$('#msg-' + item.id_str + ' a.favorite').css('color', 'red'); $('#msg-' + item.id_str + ' a.favorite').css('color', 'red');
Expand Down Expand Up @@ -305,7 +307,18 @@ $.fn.gettweets = function(){


} // if } // if
}); // each }); // each
}); // getJSON mentions // Make buttons invisible.
$('.buttons').addClass('invisible');
$('li').hover(
function() {
$(this).children('.buttons').removeClass('invisible')
},
function() {
$(this).children('.buttons').addClass('invisible')
}
);

}); // getJSON mentions
}); // getJSON home }); // getJSON home
}); //getJSON retweets }); //getJSON retweets
}); // this.each }); // this.each
Expand Down Expand Up @@ -340,7 +353,6 @@ function recalcTime() {


function refreshMessages() { function refreshMessages() {
$(".tweets").gettweets(); $(".tweets").gettweets();
// LAST_UPDATE = new Date().toGMTString();
return; return;
} }


Expand Down

0 comments on commit 94b46cc

Please sign in to comment.