From: David ‘Bombe’ Roden Date: Thu, 7 Apr 2011 09:13:41 +0000 (+0200) Subject: Add method to retrieve a Sone element by its ID. X-Git-Tag: 0.6.1^2~26^2~6 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=412752b9c15f164dbabb7e4096eeb381cd00a5f4 Add method to retrieve a Sone element by its ID. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 86475e5..908faf5 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -265,6 +265,19 @@ function getFormPassword() { return $("#sone #formPassword").text(); } +/** + * Returns the element of the Sone with the given ID. + * + * @param soneId + * The ID of the Sone + * @returns All Sone elements with the given ID + */ +function getSone(soneId) { + return $("#sone .sone").filter(function(index) { + return $(".id").text() == soneId; + }); +} + function getSoneElement(element) { return $(element).closest(".sone"); }