add css names when links are active

This commit is contained in:
John Bintz 2009-12-20 22:51:04 -05:00
parent 2ca186d739
commit 657080c990
1 changed files with 5 additions and 0 deletions

View File

@ -42,6 +42,10 @@ ComicBookmark.setup = function(id, mode, url, elements) {
['goto-tag','clear-tag'].each(function(which) { ['goto-tag','clear-tag'].each(function(which) {
hrefs[which].innerHTML = elements[which + '-' + (i.permalink ? "on" : "off")]; hrefs[which].innerHTML = elements[which + '-' + (i.permalink ? "on" : "off")];
}); });
$H(hrefs).each(function(info) {
info.value[i.permalink ? 'addClassName' : 'removeClassName']('active');
});
}; };
hrefs['tag-page'].innerHTML = elements['tag-page']; hrefs['tag-page'].innerHTML = elements['tag-page'];
@ -70,6 +74,7 @@ ComicBookmark.setup = function(id, mode, url, elements) {
var set_goto_tag = function(i) { var set_goto_tag = function(i) {
hrefs['bookmark-clicker'].href = (i.permalink ? i.permalink : "#"); hrefs['bookmark-clicker'].href = (i.permalink ? i.permalink : "#");
hrefs['bookmark-clicker'].innerHTML = elements['bookmark-clicker-' + (i.permalink ? "on" : "off")]; hrefs['bookmark-clicker'].innerHTML = elements['bookmark-clicker-' + (i.permalink ? "on" : "off")];
hrefs['bookmark-clicker'][i.permalink ? 'addClassName' : 'removeClassName']('active');
}; };
bookmark_info.onWrite = function(i) { set_goto_tag(i); } bookmark_info.onWrite = function(i) { set_goto_tag(i); }
set_goto_tag(info); set_goto_tag(info);