From 412752b9c15f164dbabb7e4096eeb381cd00a5f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 7 Apr 2011 11:13:41 +0200 Subject: [PATCH] Add method to retrieve a Sone element by its ID. --- src/main/resources/static/javascript/sone.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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"); } -- 2.7.4