Skip to content

Commit

Permalink
exclude the current tab from the tab list, hit enter to return to the…
Browse files Browse the repository at this point in the history
… last selected tab
  • Loading branch information
babyman committed Dec 28, 2009
1 parent bd67048 commit 133fb90
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions quick-tabs/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,18 @@
// draw the current tabs
$("#template").text("");
$.each(tabs, function(i, tab) {
$("#template").append($("<tr></tr>")
.attr({class:"tab", id:tab.id, window:tab.windowId})
.append("<td></td>").append($("<img></img>").attr({class:"tabimage", src:tabImage(tab), width:"16", height:"16", border:"0"}))
.append("<td></td>").append($("<div class='title'></div>").text(tab.title)).append($("<div class='url'></div>").text(tab.url))
.click(function() {
switchTabs(tab.id);
}).mouseover(function () {
$("tr.withfocus").removeClass('withfocus');
$(this).addClass('withfocus');
}));
if(i > 0) {
$("#template").append($("<tr></tr>")
.attr({class:"tab", id:tab.id, window:tab.windowId})
.append("<td></td>").append($("<img></img>").attr({class:"tabimage", src:tabImage(tab), width:"16", height:"16", border:"0"}))
.append("<td></td>").append($("<div class='title'></div>").text(tab.title)).append($("<div class='url'></div>").text(tab.url))
.click(function() {
switchTabs(tab.id);
}).mouseover(function () {
$("tr.withfocus").removeClass('withfocus');
$(this).addClass('withfocus');
}));
}
});

$("tr:visible:first").addClass("withfocus");
Expand Down

0 comments on commit 133fb90

Please sign in to comment.