Skip to content

Instantly share code, notes, and snippets.

@baldwicc
Created October 16, 2013 08:38
Show Gist options
  • Save baldwicc/7004567 to your computer and use it in GitHub Desktop.
Save baldwicc/7004567 to your computer and use it in GitHub Desktop.
Clickable Content Item Icons: Borrows the hyperlink from the content item title, clones it and wraps it around the content item's icon.
<script type="text/javascript" id="qut-clickyicons">
Event.observe(document,"dom:loaded", function() {
var contentitem_title_hyperlinks = $$('#content_listContainer > li > .item > h3 > a[href^="/webapps"]');
for (var i = 0; i < contentitem_title_hyperlinks.length; i++) {
var thislink = contentitem_title_hyperlinks[i];
var contentitem_icon = thislink.up('.item').previous('img.item_icon');
var newlink = thislink.clone(false);
contentitem_icon.wrap(newlink);
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment