From: David ‘Bombe’ Roden Date: Wed, 22 Jun 2011 18:56:21 +0000 (+0200) Subject: Add function to find the Sone ID of a Sone context menu. X-Git-Tag: 0.6.6^2~52^2~4 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=ea4f7914a1529e884f233e552edbe51f542a9b36;hp=acad4aaa7ddf0104d57654e5b272353d8799adeb Add function to find the Sone ID of a Sone context menu. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 1df8d42..383733a 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -283,6 +283,18 @@ function getSoneElement(element) { } /** + * Returns the ID of the sone of the context menu that contains the given + * element. + * + * @param element + * The element within a context menu to get the Sone ID for + * @return The Sone ID + */ +function getMenuSone(element) { + return $(element).closest(".sone-menu").find(".sone-id").text(); +} + +/** * Generates a list of Sones by concatening the names of the given sones with a * new line character (“\n”). *