aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/lib/util.js')
-rw-r--r--data/lib/util.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/data/lib/util.js b/data/lib/util.js
index 6cbb493..611d353 100644
--- a/data/lib/util.js
+++ b/data/lib/util.js
@@ -81,6 +81,19 @@ function getBugNoFromURL(url) {
}
/**
+ * Send mouse click to the specified element
+ *
+ * @param String ID of the element to send mouseclick to
+ * @return None
+ */
+function clickMouse (targetID) {
+ var localEvent = document.createEvent("MouseEvents");
+ localEvent.initMouseEvent("click", true, true, document.defaultView, 0, 0,
+ 0, 0, 0, false, false, false, false, 0, null);
+ document.getElementById(targetID).dispatchEvent(localEvent);
+}
+
+/**
* Create a A element leadink nowhere, but with listener running a callback on the click
*
* @param id String with a id to be added to the element