Skip to content

Instantly share code, notes, and snippets.

@mreidsma
Last active December 12, 2015 12:09
Show Gist options
  • Select an option

  • Save mreidsma/4770366 to your computer and use it in GitHub Desktop.

Select an option

Save mreidsma/4770366 to your computer and use it in GitHub Desktop.
In SerialsSolutions Summon, make the title of the best bet the link and get rid of the weird "More" link.
if($(".best-bet-list").length > 0) {
var bbTitle = $(".best-bet-title").text();
var bbURL = $(".best-bet").find(".more").find("a").attr("href");
var bbDesc = $(".best-bet-body").find(".detail").text();
if(bbDesc === ".") {
$("li.best-bet").html('<div class="theme-best-bet-icon"></div><div class="best-bet-title"><a href="' + bbURL + '">' + bbTitle + '</a></div>');
} else { // Has a description
$("li.best-bet").html('<div class="theme-best-bet-icon"></div><div class="best-bet-title"><a href="' + bbURL + '">' + bbTitle + '</a></div><div class="best-bet-body"><div class="detail"><p>' + bbDesc + '</p></div>');
}
}

Here's what the above script does:

Best Bets with descriptionBest bet with description (title is linked)
Best Bets with descriptionBest bet without description (title is linked)
@mreidsma
Copy link
Copy Markdown
Author

mreidsma commented Mar 8, 2013

@cockerilla
Copy link
Copy Markdown

Matt - I have had no joy with this and it looks so simple (apparently I'm more simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment